<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of VMT</title>
  <meta name="keywords" content="VMT">
  <meta name="description" content="--- THE VELOCITY MAPPING TOOLBOX ---">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
  <script type="text/javascript">
    if (top.frames.length == 0) { top.location = "../index.html"; };
  </script>
</head>
<body>
<a name="_top"></a>
<!-- menu.html VMT_4.0_dev -->
<h1>VMT
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>--- THE VELOCITY MAPPING TOOLBOX ---</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function varargout = VMT(varargin) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> --- THE VELOCITY MAPPING TOOLBOX ---
 
 VMT is a Matlab-based software for processing and visualizing ADCP data
 collected along transects in rivers or other bodies of water. VMT allows
 rapid processing, visualization, and analysis of a range of ADCP datasets
 and includes utilities to export ADCP data to files compatible with
 ArcGIS, Tecplot, and Google Earth. The software can be used to explore
 patterns of three-dimensional fluid motion through several methods for
 calculation of secondary flows (e.g. Rhoads and Kenworthy, 1998; Lane et
 al., 2000). The software also includes capabilities for analyzing the
 acoustic backscatter and bathymetric data from the ADCP. A user-friendly
 graphical user interface (GUI) enhances program functionality and
 provides ready access to two- and three- dimensional plotting functions,
 allowing rapid display and interrogation of velocity, backscatter, and
 bathymetry data.
 
 CITATION: 
 Parsons, D. R., Jackson, P. R., Czuba, J. A., Engel, F. L., Rhoads, B.
 L., Oberg, K. A., Best, J. L., Mueller, D. S., Johnson, K. K. and Riley,
 J. D. (2013), Velocity Mapping Toolbox (VMT): a processing and
 visualization suite for moving-vessel ADCP measurements. Earth Surf.
 Process. Landforms. doi: 10.1002/esp.3367

__________________________________________________________________________
 P.R. Jackson, U.S. Geological Survey, Illinois Water Science Center
 (pjackson@usgs.gov)

 Code contributed by D. Parsons, D. Mueller, J. Czuba, and F. Engel.
__________________________________________________________________________</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="VMT_BuildTecplotFile.html" class="code" title="function VMT_BuildTecplotFile(V,savefile)">VMT_BuildTecplotFile</a>	Takes the processed data structure and writes a TecPlot ASCII data file.</li><li><a href="VMT_BuildTecplotFile_XSBathy.html" class="code" title="function VMT_BuildTecplot_XSBathy(V,savefile)">VMT_BuildTecplotFile_XSBathy</a>	Takes the processed data structure and writes a TecPlot ASCII data file</li><li><a href="VMT_LoadMap.html" class="code" title="function Map = VMT_LoadMap(filetype,coord);">VMT_LoadMap</a>	</li><li><a href="VMT_MBBathy.html" class="code" title="function [A] = VMT_MBBathy(z,A,savefile,beamAng,magVar,wsedata,saveaux)">VMT_MBBathy</a>	Computes the multibeam bathymetry from the four beams of the ADCP</li><li><a href="VMT_MeanXS2GE_3D.html" class="code" title="function VMT_MeanXS2GE_3D(A,V,pathstr,filestr,vscale,voffset)">VMT_MeanXS2GE_3D</a>	Outputs the mean cross section (3-D) from VMT to Google Earth (saved as a</li><li><a href="VMT_OverlayDOQQ.html" class="code" title="function log_text = VMT_OverlayDOQQ(pathname)">VMT_OverlayDOQQ</a>	Prompts the user for a geotiff DOQQ (USGS) and overlays the aerial image</li><li><a href="VMT_PlotPlanViewQuivers.html" class="code" title="function [PVdata,fig_planview_handle,log_text] = VMT_PlotPlanViewQuivers(z,A,V,Map,drng,ascale,QuiverSpacing,pvsmwin,pshore,plot_english,varargin)">VMT_PlotPlanViewQuivers</a>	This function plots a plan view of the measurement region with a vector</li><li><a href="VMT_PlotShiptracks.html" class="code" title="function hf = VMT_PlotShiptracks(A,V,z,setends,hf)">VMT_PlotShiptracks</a>	Plots the shiptracks, and interpolated grid in the VMT GUI axes. Also</li><li><a href="VMT_PlotShoreline.html" class="code" title="function VMT_PlotShoreline(Map)">VMT_PlotShoreline</a>	Plots a shoreline map given the shoreline data structure 'Map' (see</li><li><a href="VMT_PlotXSCont.html" class="code" title="function [z,A,V,zmin,zmax,log_text,fig_contour_handle] = VMT_PlotXSCont(z,A,V,var,exag,plot_english)">VMT_PlotXSCont</a>	Plots contours for the variable 'var' within the mean cross section given</li><li><a href="VMT_PlotXSContQuiver.html" class="code" title="function [z,A,V,log_text] = VMT_PlotXSContQuiver(z,A,V,var,sf,exag,qspchorz,qspcvert,secvecvar,vvelcomp,plot_english)">VMT_PlotXSContQuiver</a>	This function plots the the contour plot (mean XS) for the variable 'var'</li><li><a href="VMT_PreProcess.html" class="code" title="function A = VMT_PreProcess(z,A)">VMT_PreProcess</a>	This function is a driver to preprocess the transects data.  Several</li><li><a href="VMT_ProcessTransects.html" class="code" title="function [A,V,log_text] = VMT_ProcessTransects(z,A,setends)">VMT_ProcessTransects</a>	Driver program to process multiple transects at a single cross-section</li><li><a href="VMT_ReadFiles.html" class="code" title="function [zPathName,zFileName,savefile,A,z] = VMT_ReadFiles(zPathName,zFileName)">VMT_ReadFiles</a>	Read in multiple ASCII output files from WinRiver or WinRiverII.</li><li><a href="VMT_SaveFigs.html" class="code" title="function VMT_SaveFigs(pathname,to_export,figure_style)">VMT_SaveFigs</a>	Saves the figures (specified by fignums) from VMT as .PNG or EPS files</li><li><a href="VMT_SmoothVar.html" class="code" title="function [V] = VMT_SmoothVar(V,hwin,vwin)">VMT_SmoothVar</a>	This routine smooths all processed variables in V struct. By default is</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->

<h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="#_sub1" class="code">function VMT_OpeningFcn(hObject, eventdata, handles, varargin)</a></li><li><a href="#_sub2" class="code">function varargout = VMT_OutputFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub3" class="code">function figure1_ResizeFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub4" class="code">function figure1_CloseRequestFcn(hObject, eventdata, handles)</a></li><li><a href="#_sub5" class="code">function menuFile_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub6" class="code">function menuOpen_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub7" class="code">function menuOpenASCII_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub8" class="code">function menuOpenMAT_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub9" class="code">function menuSave_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub10" class="code">function menuSaveMAT_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub11" class="code">function menuSaveTecplot_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub12" class="code">function menuSaveKMZFile_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub13" class="code">function menuExport_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub14" class="code">function menuFigureExportsettings_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub15" class="code">function menuPrintFormat_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub16" class="code">function menuPresentationFormat_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub17" class="code">function menuExportFigures_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub18" class="code">function menuBathymetryExportSettings_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub19" class="code">function menuExportMultibeamBathymetry_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub20" class="code">function menuParameters_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub21" class="code">function menuPlottingParameters_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub22" class="code">function menuUnits_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub23" class="code">function menuMetric_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub24" class="code">function menuEnglish_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub25" class="code">function menuSetCrossSectionEndpoints_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub26" class="code">function menuCrossSectionEndpointAutomatic_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub27" class="code">function menuCrossSectionEndpointManual_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub28" class="code">function menuPlotStyle_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub29" class="code">function menuStylePrint_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub30" class="code">function menuStylePresentation_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub31" class="code">function menuProcessingParameters_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub32" class="code">function menuKMZExport_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub33" class="code">function menuBathymetryParameters_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub34" class="code">function menuTools_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub35" class="code">function menuASCII2GIS_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub36" class="code">function menuASCII2KML_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub37" class="code">function menuHelp_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub38" class="code">function menuUsersGuide_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub39" class="code">function menuFunctionLibrary_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub40" class="code">function menuCheckForUpdates_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub41" class="code">function menuAbout_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub42" class="code">function loadDataCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub43" class="code">function saveDataCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub44" class="code">function saveBathymetryCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub45" class="code">function plottingParametersCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub46" class="code">function processingParametersCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub47" class="code">function shiptracksPlotCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub48" class="code">function planviewPlotCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub49" class="code">function crosssectionPlotCallback(hObject, eventdata, handles)</a></li><li><a href="#_sub50" class="code">function SaveMATFile_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub51" class="code">function SaveTecplotFile_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub52" class="code">function SaveGoogleEarthFile_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub53" class="code">function ExportMultibeamBathymetry_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub54" class="code">function BeamAngle_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub55" class="code">function MagneticVariation_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub56" class="code">function WSE_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub57" class="code">function OutputAuxiliaryData_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub58" class="code">function DepthRangeMin_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub59" class="code">function DepthRangeMax_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub60" class="code">function VectorScalePlanView_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub61" class="code">function VectorSpacingPlanview_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub62" class="code">function SmoothingWindowSize_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub63" class="code">function MapDepthAveragedVelocities_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub64" class="code">function DisplayShoreline_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub65" class="code">function AddBackground_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub66" class="code">function PlotPlanView_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub67" class="code">function HorizontalGridNodeSpacing_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub68" class="code">function SetCrossSectionEndpoints_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub69" class="code">function PlotShiptracks_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub70" class="code">function Contour_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub71" class="code">function VerticalExaggeration_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub72" class="code">function VectorScaleCrossSection_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub73" class="code">function HorizontalVectorSpacing_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub74" class="code">function VerticalVectorSpacing_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub75" class="code">function HorizontalSmoothingWindow_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub76" class="code">function VerticalSmoothingWindow_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub77" class="code">function PlotSecondaryFlowVectors_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub78" class="code">function SecondaryFlowVectorVariable_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub79" class="code">function IncludeVerticalVelocity_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub80" class="code">function PlotCrossSection_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub81" class="code">function ClearLog_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub82" class="code">function SaveLog_Callback(hObject, eventdata, handles)</a></li><li><a href="#_sub83" class="code">function handles = buildToolbar(handles)</a></li><li><a href="#_sub84" class="code">function load_prefs(hfigure)</a></li><li><a href="#_sub85" class="code">function store_prefs(hfigure,pref)</a></li><li><a href="#_sub86" class="code">function initGUI(handles)</a></li><li><a href="#_sub87" class="code">function set_enable(handles,enable_state)</a></li><li><a href="#_sub88" class="code">function [english_units,set_cross_section_endpoints,plot_presentation_style,plot_print_style] =</a></li><li><a href="#_sub89" class="code">function dialogUnits(hObject,eventdata,handles,the_units)</a></li><li><a href="#_sub90" class="code">function dialogEnpoints(hObject,eventdata,handles,the_endpoints)</a></li><li><a href="#_sub91" class="code">function dialogPlotStyle(hObject,eventdata,handles,the_style)</a></li><li><a href="#_sub92" class="code">function dialogOK(hObject,eventdata,h_OK)</a></li><li><a href="#_sub93" class="code">function dialogCancel(hObject,eventdata,handles)</a></li><li><a href="#_sub94" class="code">function dialogCloseReq(hObject,eventdata,h_OK)</a></li><li><a href="#_sub95" class="code">function [beam_angle,magnetic_variation,wse,output_auxilliary_data] = exportSettingsDialog(beam_angle,magnetic_variation,wse,output_auxilliary_data,hf)</a></li><li><a href="#_sub96" class="code">function dialogExportSettings(hObject,eventdata,handles)</a></li><li><a href="#_sub97" class="code">function [selected_figures] = openFiguresDialog(figure_names,hf)</a></li><li><a href="#_sub98" class="code">function dialogSelectFigures(hObject,eventdata,handles)</a></li><li><a href="#_sub99" class="code">function icons = getIcons</a></li><li><a href="#_sub100" class="code">function guiparams = createGUIparams</a></li></ul>

<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function varargout = VMT(varargin)</a>
0002 <span class="comment">% --- THE VELOCITY MAPPING TOOLBOX ---</span>
0003 <span class="comment">%</span>
0004 <span class="comment">% VMT is a Matlab-based software for processing and visualizing ADCP data</span>
0005 <span class="comment">% collected along transects in rivers or other bodies of water. VMT allows</span>
0006 <span class="comment">% rapid processing, visualization, and analysis of a range of ADCP datasets</span>
0007 <span class="comment">% and includes utilities to export ADCP data to files compatible with</span>
0008 <span class="comment">% ArcGIS, Tecplot, and Google Earth. The software can be used to explore</span>
0009 <span class="comment">% patterns of three-dimensional fluid motion through several methods for</span>
0010 <span class="comment">% calculation of secondary flows (e.g. Rhoads and Kenworthy, 1998; Lane et</span>
0011 <span class="comment">% al., 2000). The software also includes capabilities for analyzing the</span>
0012 <span class="comment">% acoustic backscatter and bathymetric data from the ADCP. A user-friendly</span>
0013 <span class="comment">% graphical user interface (GUI) enhances program functionality and</span>
0014 <span class="comment">% provides ready access to two- and three- dimensional plotting functions,</span>
0015 <span class="comment">% allowing rapid display and interrogation of velocity, backscatter, and</span>
0016 <span class="comment">% bathymetry data.</span>
0017 <span class="comment">%</span>
0018 <span class="comment">% CITATION:</span>
0019 <span class="comment">% Parsons, D. R., Jackson, P. R., Czuba, J. A., Engel, F. L., Rhoads, B.</span>
0020 <span class="comment">% L., Oberg, K. A., Best, J. L., Mueller, D. S., Johnson, K. K. and Riley,</span>
0021 <span class="comment">% J. D. (2013), Velocity Mapping Toolbox (VMT): a processing and</span>
0022 <span class="comment">% visualization suite for moving-vessel ADCP measurements. Earth Surf.</span>
0023 <span class="comment">% Process. Landforms. doi: 10.1002/esp.3367</span>
0024 <span class="comment">%</span>
0025 <span class="comment">%__________________________________________________________________________</span>
0026 <span class="comment">% P.R. Jackson, U.S. Geological Survey, Illinois Water Science Center</span>
0027 <span class="comment">% (pjackson@usgs.gov)</span>
0028 <span class="comment">%</span>
0029 <span class="comment">% Code contributed by D. Parsons, D. Mueller, J. Czuba, and F. Engel.</span>
0030 <span class="comment">%__________________________________________________________________________</span>
0031 
0032 <span class="comment">% Begin initialization code - DO NOT EDIT</span>
0033 gui_Singleton = 1;
0034 gui_State = struct(<span class="string">'gui_Name'</span>,       mfilename, <span class="keyword">...</span>
0035     <span class="string">'gui_Singleton'</span>,  gui_Singleton, <span class="keyword">...</span>
0036     <span class="string">'gui_OpeningFcn'</span>, @<a href="#_sub1" class="code" title="subfunction VMT_OpeningFcn(hObject, eventdata, handles, varargin)">VMT_OpeningFcn</a>, <span class="keyword">...</span>
0037     <span class="string">'gui_OutputFcn'</span>,  @<a href="#_sub2" class="code" title="subfunction varargout = VMT_OutputFcn(hObject, eventdata, handles)">VMT_OutputFcn</a>, <span class="keyword">...</span>
0038     <span class="string">'gui_LayoutFcn'</span>,  [] , <span class="keyword">...</span>
0039     <span class="string">'gui_Callback'</span>,   []);
0040 <span class="keyword">if</span> nargin &amp;&amp; ischar(varargin{1})
0041     gui_State.gui_Callback = str2func(varargin{1});
0042 <span class="keyword">end</span>
0043 
0044 <span class="keyword">if</span> nargout
0045     [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
0046 <span class="keyword">else</span>
0047     gui_mainfcn(gui_State, varargin{:});
0048 <span class="keyword">end</span>
0049 <span class="comment">% End initialization code - DO NOT EDIT</span>
0050 
0051 <span class="comment">%#ok&lt;*DEFNU,*INUSL,*INUSD&gt;</span>
0052 
0053 <span class="comment">% --- Executes just before VMT is made visible.</span>
0054 <a name="_sub1" href="#_subfunctions" class="code">function VMT_OpeningFcn(hObject, eventdata, handles, varargin)</a>
0055 <span class="comment">% This function has no output args, see OutputFcn.</span>
0056 <span class="comment">% hObject    handle to figure</span>
0057 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0058 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0059 <span class="comment">% varargin   command line arguments to VMT (see VARARGIN)</span>
0060 
0061 <span class="comment">% Choose default command line output for VMT</span>
0062 handles.output = hObject;
0063 
0064 <span class="comment">% Build the GUI toolbar:</span>
0065 <span class="comment">% ----------------------</span>
0066 handles = <a href="#_sub83" class="code" title="subfunction handles = buildToolbar(handles)">buildToolbar</a>(handles);
0067 
0068 <span class="comment">% Ensure path to utils &amp; docs is available</span>
0069 <span class="comment">% ----------------------------------------</span>
0070 <span class="keyword">if</span> ~isdeployed
0071     filesep = <span class="string">'\'</span>; <span class="comment">% windows</span>
0072     utilspath = [pwd filesep <span class="string">'utils'</span>];
0073     docspath  = [pwd filesep <span class="string">'doc'</span>];
0074     toolspath = [pwd filesep <span class="string">'tools'</span>];
0075     addpath(utilspath,docspath,toolspath)
0076 <span class="keyword">end</span>
0077 
0078 <span class="comment">% Update handles structure</span>
0079 <span class="comment">% ------------------------</span>
0080 guidata(hObject, handles);
0081 
0082 <span class="comment">% Load the GUI preferences:</span>
0083 <span class="comment">% -------------------------</span>
0084 <a href="#_sub84" class="code" title="subfunction load_prefs(hfigure)">load_prefs</a>(handles.figure1)
0085 
0086 <span class="comment">% Initialize the GUI parameters:</span>
0087 <span class="comment">% ------------------------------</span>
0088 guiparams = <a href="#_sub100" class="code" title="subfunction guiparams = createGUIparams">createGUIparams</a>;
0089 guiparams.vmt_version = <span class="string">'v4.0_beta'</span>;
0090 
0091 <span class="comment">% Draw the VMT Background</span>
0092 <span class="comment">% -----------------</span>
0093 pos = get(handles.figure1,<span class="string">'position'</span>);
0094 axes(handles.VMTBackground);
0095 <span class="keyword">if</span> isempty(dir(fullfile(matlabroot,<span class="string">'toolbox'</span>,<span class="string">'images'</span>)))
0096     X = imread(<span class="string">'VMT_Background.png'</span>);
0097     imdisp(X,<span class="string">'size'</span>,[pos(4) pos(3)]) <span class="comment">% Avoids problems with users not having Image Processing TB</span>
0098 <span class="keyword">else</span>
0099     X = imread(<span class="string">'VMT_Background.png'</span>);
0100     X = imresize(X, [pos(4) pos(3)]);
0101     X = uint8(X);
0102     imshow(X,<span class="string">'Border'</span>,<span class="string">'tight'</span>)
0103 <span class="keyword">end</span>
0104 uistack(handles.VMTBackground,<span class="string">'bottom'</span>)
0105 
0106 <span class="comment">% Store the application data:</span>
0107 <span class="comment">% ---------------------------</span>
0108 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0109 
0110 <span class="comment">% Initialize the GUI:</span>
0111 <span class="comment">% -------------------</span>
0112 <a href="#_sub86" class="code" title="subfunction initGUI(handles)">initGUI</a>(handles)
0113 <a href="#_sub87" class="code" title="subfunction set_enable(handles,enable_state)">set_enable</a>(handles,<span class="string">'init'</span>)
0114 <span class="comment">% set(handles.GraphicsExportPanel,'Visible','off')</span>
0115 <span class="comment">% set(handles.ProcessingPanel,'Visible','off')</span>
0116 pos = get(handles.figure1,<span class="string">'Position'</span>);
0117 <span class="comment">% pos(3) = 545;</span>
0118 set(handles.figure1,<span class="string">'Position'</span>,pos)
0119 set(handles.figure1,<span class="string">'Resize'</span>,<span class="string">'on'</span>)
0120 
0121 <span class="comment">% UIWAIT makes VMT wait for user response (see UIRESUME)</span>
0122 <span class="comment">% uiwait(handles.figure1);</span>
0123 <span class="comment">% [EOF] VMT_OpeningFcn</span>
0124 
0125 
0126 <span class="comment">% --- Outputs from this function are returned to the command line.</span>
0127 <a name="_sub2" href="#_subfunctions" class="code">function varargout = VMT_OutputFcn(hObject, eventdata, handles)</a>
0128 <span class="comment">% varargout  cell array for returning output args (see VARARGOUT);</span>
0129 <span class="comment">% hObject    handle to figure</span>
0130 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0131 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0132 
0133 <span class="comment">% Get default command line output from handles structure</span>
0134 varargout{1} = handles.output;
0135 <span class="comment">% [EOF] VMT_OutputFcn</span>
0136 
0137 <span class="comment">% --- Executes when figure1 is resized.</span>
0138 <a name="_sub3" href="#_subfunctions" class="code">function figure1_ResizeFcn(hObject, eventdata, handles)</a>
0139 
0140 <span class="comment">% Draw the VMT Background</span>
0141 <span class="comment">% -----------------</span>
0142 pos = get(handles.figure1,<span class="string">'position'</span>);
0143 axes(handles.VMTBackground);
0144 <span class="keyword">if</span> isempty(dir(fullfile(matlabroot,<span class="string">'toolbox'</span>,<span class="string">'images'</span>)))
0145     X = imread(<span class="string">'VMT_Background.png'</span>);
0146     imdisp(X,<span class="string">'size'</span>,[pos(4) pos(3)]) <span class="comment">% Avoids problems with users not having Image Processing TB</span>
0147 <span class="keyword">else</span>
0148     X = imread(<span class="string">'VMT_Background.png'</span>);
0149     X = imresize(X, [pos(4) pos(3)]);
0150     X = uint8(X);
0151     imshow(X,<span class="string">'Border'</span>,<span class="string">'tight'</span>)
0152 <span class="keyword">end</span>
0153 uistack(handles.VMTBackground,<span class="string">'bottom'</span>)
0154 
0155 <span class="comment">% --- Executes when user attempts to close figure1.</span>
0156 <a name="_sub4" href="#_subfunctions" class="code">function figure1_CloseRequestFcn(hObject, eventdata, handles)</a>
0157 <span class="comment">% hObject    handle to figure1 (see GCBO)</span>
0158 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
0159 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
0160 
0161 <span class="comment">% Hint: delete(hObject) closes the figure</span>
0162 close_button = questdlg(<span class="keyword">...</span>
0163     <span class="string">'You are about to exit VMT. Any unsaved work will be lost. Are you sure?'</span>,<span class="keyword">...</span>
0164     <span class="string">'Exit VMT?'</span>,<span class="string">'No'</span>);
0165 <span class="keyword">switch</span> close_button
0166     <span class="keyword">case</span> <span class="string">'Yes'</span>
0167         delete(hObject)
0168         close all hidden
0169     <span class="keyword">otherwise</span>
0170         <span class="keyword">return</span>
0171 <span class="keyword">end</span>
0172 <span class="comment">% [EOF] figure1_CloseRequestFcn</span>
0173 
0174 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%</span>
0175 <span class="comment">% MENU BAR CALLBACKS %</span>
0176 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%</span>
0177 
0178 <span class="comment">% --------------------------------------------------------------------</span>
0179 <a name="_sub5" href="#_subfunctions" class="code">function menuFile_Callback(hObject, eventdata, handles)</a>
0180 <span class="comment">% Empty</span>
0181 
0182 <span class="comment">% --------------------------------------------------------------------</span>
0183 <a name="_sub6" href="#_subfunctions" class="code">function menuOpen_Callback(hObject, eventdata, handles)</a>
0184 <span class="comment">% Empty</span>
0185 
0186 <span class="comment">% --------------------------------------------------------------------</span>
0187 <a name="_sub7" href="#_subfunctions" class="code">function menuOpenASCII_Callback(hObject, eventdata, handles)</a>
0188 <a href="#_sub42" class="code" title="subfunction loadDataCallback(hObject, eventdata, handles)">loadDataCallback</a>(hObject, eventdata, handles)
0189 <span class="comment">% [EOF] menuOpenASCII_Callback</span>
0190 
0191 <span class="comment">% --------------------------------------------------------------------</span>
0192 <a name="_sub8" href="#_subfunctions" class="code">function menuOpenMAT_Callback(hObject, eventdata, handles)</a>
0193 
0194 <span class="comment">% Get the Application data:</span>
0195 <span class="comment">% -------------------------</span>
0196 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0197 guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0198 
0199 <span class="comment">% Ask the user to select files:</span>
0200 <span class="comment">% -----------------------------</span>
0201 <span class="comment">% current_file = fullfile(guiparams.data_folder,guiparams.data_files{1});</span>
0202 <span class="comment">% current_file = fullfile(guiprefs.mat_path,guiprefs.mat_file);</span>
0203 <span class="keyword">if</span> iscell(guiprefs.mat_file)
0204     uifile = fullfile(guiparams.data_folder,guiparams.data_files{1});
0205 <span class="keyword">else</span>
0206     uifile = fullfile(guiprefs.mat_path,guiprefs.mat_file);
0207 <span class="keyword">end</span>
0208 [filename,pathname] = <span class="keyword">...</span>
0209     uigetfile({<span class="string">'*.mat'</span>,<span class="string">'MAT-files (*.mat)'</span>}, <span class="keyword">...</span>
0210     <span class="string">'Select MAT File'</span>, <span class="keyword">...</span>
0211     uifile, <span class="string">'MultiSelect'</span>,<span class="string">'on'</span>);
0212 
0213 <span class="keyword">if</span> ischar(filename) <span class="comment">% Single MAT file loaded</span>
0214     <span class="comment">% Load the data:</span>
0215     <span class="comment">% --------------</span>
0216     vars = load(fullfile(pathname,filename));
0217     
0218     <span class="comment">% Make sure the selected file is a valid file:</span>
0219     <span class="comment">% --------------------------------------------</span>
0220     varnames = fieldnames(vars);
0221     <span class="keyword">if</span> isequal(sort(varnames),{<span class="string">'A'</span> <span class="string">'Map'</span> <span class="string">'V'</span> <span class="string">'z'</span>}')
0222         guiparams.mat_path = pathname;
0223         guiparams.mat_file = filename;
0224         guiparams.z = vars.z;
0225         guiparams.A = vars.A;
0226         guiparams.V = vars.V;
0227         
0228         <span class="comment">% Update the preferences:</span>
0229         <span class="comment">% -----------------------</span>
0230         guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0231         guiprefs.mat_path = pathname;
0232         guiprefs.mat_file = filename;
0233         setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
0234         <a href="#_sub85" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'mat'</span>)
0235                      
0236         <span class="comment">% Re-store the Application Data:</span>
0237         <span class="comment">% ------------------------------</span>
0238         setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0239         
0240         <span class="comment">% Update the GUI:</span>
0241         <span class="comment">% ---------------</span>
0242         <a href="#_sub87" class="code" title="subfunction set_enable(handles,enable_state)">set_enable</a>(handles,<span class="string">'fileloaded'</span>)
0243     <span class="keyword">else</span> <span class="comment">% Not a valid file</span>
0244         errordlg(<span class="string">'The selected file is not a valid ADCP data MAT file.'</span>, <span class="keyword">...</span>
0245             <span class="string">'Invalid File...'</span>)
0246     <span class="keyword">end</span>
0247     
0248 <span class="keyword">elseif</span> iscell(filename) <span class="comment">% Multiple MAT files loaded</span>
0249     <span class="comment">% Set the filenames</span>
0250     <span class="comment">% -----------------</span>
0251     guiparams.mat_path = pathname;
0252     guiparams.mat_file = filename;
0253     
0254     <span class="comment">% Push status to log window</span>
0255     <span class="comment">% -------------------------</span>
0256     log_text = {<span class="keyword">...</span>
0257         <span class="string">'Loading previously processed MAT files.'</span>;<span class="keyword">...</span>
0258         <span class="string">'Directory:'</span>};
0259     log_text = vertcat(log_text, pathname, {<span class="string">'Files:'</span>}, filename');
0260     statusLogging(handles.LogWindow,log_text)
0261     
0262     <span class="comment">% Update the Application Data:</span>
0263     <span class="comment">% ------------------------------</span>
0264     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0265     
0266     <span class="comment">% Update the persistent preferences:</span>
0267     <span class="comment">% ----------------------------------</span>
0268     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0269     guiprefs.mat_path = pathname;
0270     guiprefs.mat_file = filename;
0271     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
0272     <a href="#_sub85" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'mat'</span>)
0273         
0274     <span class="comment">% Update the GUI:</span>
0275     <span class="comment">% ---------------</span>
0276     <a href="#_sub87" class="code" title="subfunction set_enable(handles,enable_state)">set_enable</a>(handles,<span class="string">'multiplematfiles'</span>)
0277 <span class="keyword">end</span>
0278 
0279 <span class="comment">% [EOF] menuOpenMAT_Callback</span>
0280 
0281 <span class="comment">% --------------------------------------------------------------------</span>
0282 <a name="_sub9" href="#_subfunctions" class="code">function menuSave_Callback(hObject, eventdata, handles)</a>
0283 <span class="comment">% Empty</span>
0284 
0285 <span class="comment">% --------------------------------------------------------------------</span>
0286 <a name="_sub10" href="#_subfunctions" class="code">function menuSaveMAT_Callback(hObject, eventdata, handles)</a>
0287 <a href="#_sub43" class="code" title="subfunction saveDataCallback(hObject, eventdata, handles)">saveDataCallback</a>(hObject, eventdata, handles)
0288 <span class="comment">% [EOF] menuSaveMAT_Callback</span>
0289 
0290 <span class="comment">% --------------------------------------------------------------------</span>
0291 <a name="_sub11" href="#_subfunctions" class="code">function menuSaveTecplot_Callback(hObject, eventdata, handles)</a>
0292 <a href="#_sub51" class="code" title="subfunction SaveTecplotFile_Callback(hObject, eventdata, handles)">SaveTecplotFile_Callback</a>(handles,eventdata,handles)
0293 <span class="comment">% [EOF] menuSaveTecplot_Callback</span>
0294 
0295 <span class="comment">% --------------------------------------------------------------------</span>
0296 <a name="_sub12" href="#_subfunctions" class="code">function menuSaveKMZFile_Callback(hObject, eventdata, handles)</a>
0297 <a href="#_sub52" class="code" title="subfunction SaveGoogleEarthFile_Callback(hObject, eventdata, handles)">SaveGoogleEarthFile_Callback</a>(handles,eventdata,handles)
0298 <span class="comment">% [EOF] menuSaveKMZFile_Callback</span>
0299 
0300 <span class="comment">% --------------------------------------------------------------------</span>
0301 <a name="_sub13" href="#_subfunctions" class="code">function menuExport_Callback(hObject, eventdata, handles)</a>
0302 <span class="comment">% Empty</span>
0303 
0304 <span class="comment">% --------------------------------------------------------------------</span>
0305 <a name="_sub14" href="#_subfunctions" class="code">function menuFigureExportsettings_Callback(hObject, eventdata, handles)</a>
0306 <span class="comment">% Empty</span>
0307 
0308 <span class="comment">% --------------------------------------------------------------------</span>
0309 <a name="_sub15" href="#_subfunctions" class="code">function menuPrintFormat_Callback(hObject, eventdata, handles)</a>
0310 
0311 <span class="comment">% Get the Application Data:</span>
0312 <span class="comment">% -------------------------</span>
0313 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0314 
0315 <span class="comment">% Update the Application Data:</span>
0316 <span class="comment">% ----------------------------</span>
0317 guiparams.print        = true;
0318 guiparams.presentation = false;
0319 
0320 <span class="comment">% Re-store the Application data:</span>
0321 <span class="comment">% ------------------------------</span>
0322 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0323 
0324 <span class="comment">% Update the GUI:</span>
0325 <span class="comment">% ---------------</span>
0326 set(handles.menuPrintFormat,       <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0327 set(handles.menuPresentationFormat,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
0328 
0329 <span class="comment">% [EOF] menuPrintFormat_Callback</span>
0330 
0331 
0332 <span class="comment">% --------------------------------------------------------------------</span>
0333 <a name="_sub16" href="#_subfunctions" class="code">function menuPresentationFormat_Callback(hObject, eventdata, handles)</a>
0334 
0335 <span class="comment">% Get the Application Data:</span>
0336 <span class="comment">% -------------------------</span>
0337 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0338 
0339 <span class="comment">% Update the Application Data:</span>
0340 <span class="comment">% ----------------------------</span>
0341 guiparams.print        = false;
0342 guiparams.presentation = true;
0343 
0344 <span class="comment">% Re-store the Application data:</span>
0345 <span class="comment">% ------------------------------</span>
0346 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0347 
0348 <span class="comment">% Update the GUI:</span>
0349 <span class="comment">% ---------------</span>
0350 set(handles.menuPrintFormat,       <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0351 set(handles.menuPresentationFormat,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
0352 
0353 <span class="comment">% [EOF] menuPresentationFormat_Callback</span>
0354 
0355 <span class="comment">% --------------------------------------------------------------------</span>
0356 <a name="_sub17" href="#_subfunctions" class="code">function menuExportFigures_Callback(hObject, eventdata, handles)</a>
0357 <span class="comment">% Get the Application data:</span>
0358 <span class="comment">% -------------------------</span>
0359 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0360 guiprefs  = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0361 
0362 <span class="comment">% Find what plots exist already</span>
0363 fig_handles = findobj(<span class="string">'type'</span>,<span class="string">'figure'</span>);
0364 fig_names   = get(fig_handles,<span class="string">'name'</span>);
0365 
0366 <span class="comment">% Remove the VMT GUI as a valid figure in the list</span>
0367 [~, idx] = ismember(get(handles.figure1,<span class="string">'Name'</span>), fig_names);
0368 <span class="keyword">if</span> ~isempty(idx)
0369     fig_names(idx) = [];
0370 <span class="keyword">end</span>
0371 
0372 <span class="keyword">if</span> guiparams.presentation
0373     figure_style = <span class="string">'presentation'</span>;
0374 <span class="keyword">else</span>
0375     figure_style = <span class="string">'print'</span>;
0376 <span class="keyword">end</span>
0377 
0378 [selected_figures] = <a href="#_sub97" class="code" title="subfunction [selected_figures] = openFiguresDialog(figure_names,hf)">openFiguresDialog</a>(fig_names,handles.figure1);
0379 
0380 <span class="keyword">if</span> isempty(selected_figures) <span class="comment">% User pressed cancel</span>
0381     <span class="keyword">return</span>
0382 <span class="keyword">else</span>
0383     <span class="keyword">for</span> i = 1:length(selected_figures)
0384         <a href="VMT_SaveFigs.html" class="code" title="function VMT_SaveFigs(pathname,to_export,figure_style)">VMT_SaveFigs</a>(guiprefs.mat_path,selected_figures(i),figure_style)
0385     <span class="keyword">end</span>
0386 <span class="keyword">end</span>
0387 
0388 
0389 <span class="comment">% [EOF] menuExportFigures_Callback</span>
0390 
0391 <span class="comment">% --------------------------------------------------------------------</span>
0392 <a name="_sub18" href="#_subfunctions" class="code">function menuBathymetryExportSettings_Callback(hObject, eventdata, handles)</a>
0393 <span class="comment">% Get the Application data:</span>
0394 <span class="comment">% -------------------------</span>
0395 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0396 beam_angle = guiparams.beam_angle; 
0397 magnetic_variation = guiparams.magnetic_variation; 
0398 wse = guiparams.wse;
0399 output_auxilliary_data = guiparams.output_auxiliary_data; 
0400 
0401 <span class="comment">% Open dialog and allow user to select settings</span>
0402 <span class="comment">% ---------------------------------------------</span>
0403 [guiparams.beam_angle,<span class="keyword">...</span>
0404     guiparams.magnetic_variation,<span class="keyword">...</span>
0405     guiparams.wse,<span class="keyword">...</span>
0406     guiparams.output_auxilliary_data] = <span class="keyword">...</span>
0407     <a href="#_sub95" class="code" title="subfunction [beam_angle,magnetic_variation,wse,output_auxilliary_data] = exportSettingsDialog(beam_angle,magnetic_variation,wse,output_auxilliary_data,hf)">exportSettingsDialog</a>(beam_angle,magnetic_variation,wse,output_auxilliary_data,handles.figure1);
0408 
0409 <span class="comment">% Re-store the Application data:</span>
0410 <span class="comment">% ------------------------------</span>
0411 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0412 
0413 <span class="comment">% [EOF] menuExportSettings_Callback</span>
0414 
0415 <span class="comment">% --------------------------------------------------------------------</span>
0416 <a name="_sub19" href="#_subfunctions" class="code">function menuExportMultibeamBathymetry_Callback(hObject, eventdata, handles)</a>
0417 <a href="#_sub53" class="code" title="subfunction ExportMultibeamBathymetry_Callback(hObject, eventdata, handles)">ExportMultibeamBathymetry_Callback</a>(hObject, eventdata, handles);
0418 <span class="comment">% [EOF] menuExportMultibeamBathymetry_Callback</span>
0419 
0420 <span class="comment">% --------------------------------------------------------------------</span>
0421 <a name="_sub20" href="#_subfunctions" class="code">function menuParameters_Callback(hObject, eventdata, handles)</a>
0422 <span class="comment">% Empty</span>
0423 
0424 <span class="comment">% --------------------------------------------------------------------</span>
0425 <a name="_sub21" href="#_subfunctions" class="code">function menuPlottingParameters_Callback(hObject, eventdata, handles)</a>
0426 <span class="comment">% Empty</span>
0427 
0428 <span class="comment">% --------------------------------------------------------------------</span>
0429 <a name="_sub22" href="#_subfunctions" class="code">function menuUnits_Callback(hObject, eventdata, handles)</a>
0430 <span class="comment">% Empty</span>
0431 
0432 <span class="comment">% --------------------------------------------------------------------</span>
0433 <a name="_sub23" href="#_subfunctions" class="code">function menuMetric_Callback(hObject, eventdata, handles)</a>
0434 <span class="comment">% Set the Plotting Parameter Units to &quot;metric&quot;</span>
0435 
0436 <span class="comment">% Get the Application Data:</span>
0437 <span class="comment">% -------------------------</span>
0438 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0439 
0440 <span class="comment">% Update the Application Data:</span>
0441 <span class="comment">% ----------------------------</span>
0442 guiparams.english_units = false;
0443 
0444 <span class="comment">% Re-store the Application data:</span>
0445 <span class="comment">% ------------------------------</span>
0446 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0447 
0448 <span class="comment">% Update the GUI:</span>
0449 <span class="comment">% ---------------</span>
0450 set(handles.menuMetric, <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0451 set(handles.menuEnglish,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
0452 
0453 <span class="comment">% [EOF] menuMetric_Callback</span>
0454 
0455 
0456 <span class="comment">% --------------------------------------------------------------------</span>
0457 <a name="_sub24" href="#_subfunctions" class="code">function menuEnglish_Callback(hObject, eventdata, handles)</a>
0458 <span class="comment">% Set the Plotting Parameter Units to &quot;english&quot;</span>
0459 
0460 <span class="comment">% Get the Application Data:</span>
0461 <span class="comment">% -------------------------</span>
0462 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0463 
0464 <span class="comment">% Update the Application Data:</span>
0465 <span class="comment">% ----------------------------</span>
0466 guiparams.english_units = true;
0467 
0468 <span class="comment">% Re-store the Application data:</span>
0469 <span class="comment">% ------------------------------</span>
0470 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0471 
0472 <span class="comment">% Update the GUI:</span>
0473 <span class="comment">% ---------------</span>
0474 set(handles.menuMetric, <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0475 set(handles.menuEnglish,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
0476 
0477 <span class="comment">% [EOF] menuEnglish_Callback</span>
0478 
0479 
0480 <span class="comment">% --------------------------------------------------------------------</span>
0481 <a name="_sub25" href="#_subfunctions" class="code">function menuSetCrossSectionEndpoints_Callback(hObject, eventdata, handles)</a>
0482 <span class="comment">% Empty</span>
0483 
0484 <span class="comment">% --------------------------------------------------------------------</span>
0485 <a name="_sub26" href="#_subfunctions" class="code">function menuCrossSectionEndpointAutomatic_Callback(hObject, eventdata, handles)</a>
0486 <span class="comment">% Set cross-section endpoints automatically</span>
0487 
0488 <span class="comment">% Get the Application Data:</span>
0489 <span class="comment">% -------------------------</span>
0490 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0491 
0492 <span class="comment">% Update the Application Data:</span>
0493 <span class="comment">% ----------------------------</span>
0494 guiparams.set_cross_section_endpoints = false;
0495 
0496 <span class="comment">% Re-store the Application data:</span>
0497 <span class="comment">% ------------------------------</span>
0498 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0499 
0500 <span class="comment">% Update the GUI:</span>
0501 <span class="comment">% ---------------</span>
0502 set(handles.menuCrossSectionEndpointAutomatic, <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0503 set(handles.menuCrossSectionEndpointManual,    <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0504 
0505 <span class="comment">% [EOF] menuCrossSectionEndpointAutomatic_Callback</span>
0506 
0507 
0508 <span class="comment">% --------------------------------------------------------------------</span>
0509 <a name="_sub27" href="#_subfunctions" class="code">function menuCrossSectionEndpointManual_Callback(hObject, eventdata, handles)</a>
0510 <span class="comment">% Set cross-section endpoints manually</span>
0511 
0512 <span class="comment">% Get the Application Data:</span>
0513 <span class="comment">% -------------------------</span>
0514 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0515 
0516 <span class="comment">% Update the Application Data:</span>
0517 <span class="comment">% ----------------------------</span>
0518 guiparams.set_cross_section_endpoints = true;
0519 
0520 <span class="comment">% Re-store the Application data:</span>
0521 <span class="comment">% ------------------------------</span>
0522 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0523 
0524 <span class="comment">% Update the GUI:</span>
0525 <span class="comment">% ---------------</span>
0526 set(handles.menuCrossSectionEndpointAutomatic, <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0527 set(handles.menuCrossSectionEndpointManual,    <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0528 
0529 <span class="comment">% [EOF] menuCrossSectionEndpointManual_Callback</span>
0530 
0531 
0532 
0533 
0534 <span class="comment">% --------------------------------------------------------------------</span>
0535 <a name="_sub28" href="#_subfunctions" class="code">function menuPlotStyle_Callback(hObject, eventdata, handles)</a>
0536 <span class="comment">% Empty</span>
0537 
0538 <span class="comment">% --------------------------------------------------------------------</span>
0539 <a name="_sub29" href="#_subfunctions" class="code">function menuStylePrint_Callback(hObject, eventdata, handles)</a>
0540 
0541 <span class="comment">% Get the Application Data:</span>
0542 <span class="comment">% -------------------------</span>
0543 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0544 
0545 <span class="comment">% Update the Application Data:</span>
0546 <span class="comment">% ----------------------------</span>
0547 guiparams.print        = true;
0548 guiparams.presentation = false;
0549 
0550 <span class="comment">% Re-store the Application data:</span>
0551 <span class="comment">% ------------------------------</span>
0552 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0553 
0554 <span class="comment">% Update the GUI:</span>
0555 <span class="comment">% ---------------</span>
0556 set(handles.menuStylePrint,        <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0557 set(handles.menuStylePresentation, <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0558 set(handles.menuPrintFormat,       <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0559 set(handles.menuPresentationFormat,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
0560 
0561 <span class="comment">% Modify the existing figures</span>
0562 <span class="comment">% ---------------------------</span>
0563 <span class="comment">% Find what plots exist already</span>
0564 hf = findobj(<span class="string">'type'</span>,<span class="string">'figure'</span>);
0565 valid_names = {<span class="string">'Plan View Map'</span>; <span class="string">'Mean Cross Section Contour'</span>};
0566 
0567 <span class="comment">% Defaults for Print Stlye Figure</span>
0568 BkgdColor   = <span class="string">'white'</span>;
0569 AxColor     = <span class="string">'black'</span>;
0570 FigColor    = <span class="string">'white'</span>; <span class="comment">% [0.3 0.3 0.3]</span>
0571 FntSize     = 14;
0572 
0573 <span class="comment">% Loop through valid figures and adjust</span>
0574 <span class="comment">% -------------------------------------</span>
0575 <span class="keyword">if</span> ~isempty(hf) &amp;&amp;  any(ishandle(hf))
0576     
0577     <span class="keyword">for</span> i = 1:length(valid_names)
0578         <span class="keyword">switch</span> valid_names{i}
0579             <span class="keyword">case</span> <span class="string">'Plan View Map'</span>
0580                 <span class="comment">% Focus the figure</span>
0581                 hff = findobj(<span class="string">'name'</span>,<span class="string">'Plan View Map'</span>);
0582                 <span class="keyword">if</span> ~isempty(hff) &amp;&amp;  ishandle(hff)
0583                     figure(hff)
0584                     
0585                     <span class="comment">% Make the changes to figure</span>
0586                     set(gcf,<span class="string">'Color'</span>,BkgdColor);
0587                     set(gca,<span class="string">'FontSize'</span>,FntSize)
0588                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize)
0589                     set(gca,<span class="string">'Color'</span>,FigColor)
0590                     set(gca,<span class="string">'XColor'</span>,AxColor)
0591                     set(gca,<span class="string">'YColor'</span>,AxColor)
0592                     set(gca,<span class="string">'ZColor'</span>,AxColor)
0593                     set(findobj(gcf,<span class="string">'tag'</span>,<span class="string">'Colorbar'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'XColor'</span>,AxColor,<span class="string">'YColor'</span>,AxColor);
0594                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0595                     set(get(gca,<span class="string">'xLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0596                     set(get(gca,<span class="string">'yLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0597                 <span class="keyword">end</span>
0598             <span class="keyword">case</span> <span class="string">'Mean Cross Section Contour'</span>
0599                 <span class="comment">% Focus the figure</span>
0600                 hff = findobj(<span class="string">'name'</span>,<span class="string">'Mean Cross Section Contour'</span>);
0601                 <span class="keyword">if</span> ~isempty(hff) &amp;&amp;  ishandle(hff)
0602                     figure(hff)
0603                     
0604                     <span class="comment">% Make the changes to figure</span>
0605                     set(gcf,<span class="string">'Color'</span>,BkgdColor);
0606                     set(gca,<span class="string">'FontSize'</span>,FntSize)
0607                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize)
0608                     set(gca,<span class="string">'Color'</span>,FigColor)
0609                     set(gca,<span class="string">'XColor'</span>,AxColor)
0610                     set(gca,<span class="string">'YColor'</span>,AxColor)
0611                     set(gca,<span class="string">'ZColor'</span>,AxColor)
0612                     set(findobj(gcf,<span class="string">'tag'</span>,<span class="string">'Colorbar'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'XColor'</span>,AxColor,<span class="string">'YColor'</span>,AxColor);
0613                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0614                     set(get(gca,<span class="string">'xLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0615                     set(get(gca,<span class="string">'yLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0616                     set(findobj(gca,<span class="string">'tag'</span>,<span class="string">'PlotBedElevation'</span>)   ,<span class="string">'color'</span>    ,AxColor)
0617                     set(findobj(gca,<span class="string">'tag'</span>,<span class="string">'ReferenceVectorText'</span>),<span class="string">'color'</span>    ,AxColor)
0618                 <span class="keyword">end</span>
0619             <span class="keyword">otherwise</span>
0620         <span class="keyword">end</span>
0621     <span class="keyword">end</span>
0622     
0623     
0624 <span class="keyword">end</span>
0625 
0626 
0627 <span class="comment">%[EOF] menuStylePrint_Callback</span>
0628 
0629 
0630 <span class="comment">% --------------------------------------------------------------------</span>
0631 <a name="_sub30" href="#_subfunctions" class="code">function menuStylePresentation_Callback(hObject, eventdata, handles)</a>
0632 <span class="comment">% Get the Application Data:</span>
0633 <span class="comment">% -------------------------</span>
0634 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0635 
0636 <span class="comment">% Update the Application Data:</span>
0637 <span class="comment">% ----------------------------</span>
0638 guiparams.print        = false;
0639 guiparams.presentation = true;
0640 
0641 <span class="comment">% Re-store the Application data:</span>
0642 <span class="comment">% ------------------------------</span>
0643 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0644 
0645 <span class="comment">% Update the GUI:</span>
0646 <span class="comment">% ---------------</span>
0647 set(handles.menuStylePrint,        <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0648 set(handles.menuStylePresentation, <span class="string">'Checked'</span>,<span class="string">'on'</span>)
0649 set(handles.menuPrintFormat,       <span class="string">'Checked'</span>,<span class="string">'off'</span>)
0650 set(handles.menuPresentationFormat,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
0651 
0652 <span class="comment">% Modify the existing figures</span>
0653 <span class="comment">% ---------------------------</span>
0654 <span class="comment">% Find what plots exist already</span>
0655 hf = findobj(<span class="string">'type'</span>,<span class="string">'figure'</span>);
0656 valid_names = {<span class="string">'Plan View Map'</span>; <span class="string">'Mean Cross Section Contour'</span>};
0657 
0658 <span class="comment">% Defaults for Print Stlye Figure</span>
0659 <span class="comment">% -------------------------------</span>
0660 BkgdColor   = <span class="string">'black'</span>;
0661 AxColor     = <span class="string">'white'</span>;
0662 FigColor    = <span class="string">'black'</span>; <span class="comment">% [0.3 0.3 0.3]</span>
0663 FntSize     = 14;
0664 
0665 <span class="comment">% Loop through valid figures and adjust</span>
0666 <span class="comment">% -------------------------------------</span>
0667 <span class="keyword">if</span> ~isempty(hf) &amp;&amp;  any(ishandle(hf))
0668     
0669     <span class="keyword">for</span> i = 1:length(valid_names)
0670         <span class="keyword">switch</span> valid_names{i}
0671             <span class="keyword">case</span> <span class="string">'Plan View Map'</span>
0672                 <span class="comment">% Focus the figure</span>
0673                 hff = findobj(<span class="string">'name'</span>,<span class="string">'Plan View Map'</span>);
0674                 <span class="keyword">if</span> ~isempty(hff) &amp;&amp;  ishandle(hff)
0675                     figure(hff)
0676                     
0677                     <span class="comment">% Make the changes to figure</span>
0678                     set(gcf,<span class="string">'Color'</span>,BkgdColor);
0679                     set(gca,<span class="string">'FontSize'</span>,FntSize)
0680                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize)
0681                     set(gca,<span class="string">'Color'</span>,FigColor)
0682                     set(gca,<span class="string">'XColor'</span>,AxColor)
0683                     set(gca,<span class="string">'YColor'</span>,AxColor)
0684                     set(gca,<span class="string">'ZColor'</span>,AxColor)
0685                     set(findobj(gcf,<span class="string">'tag'</span>,<span class="string">'Colorbar'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'XColor'</span>,AxColor,<span class="string">'YColor'</span>,AxColor);
0686                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0687                     set(get(gca,<span class="string">'xLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0688                     set(get(gca,<span class="string">'yLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0689                 <span class="keyword">end</span>
0690             <span class="keyword">case</span> <span class="string">'Mean Cross Section Contour'</span>
0691                 <span class="comment">% Focus the figure</span>
0692                 hff = findobj(<span class="string">'name'</span>,<span class="string">'Mean Cross Section Contour'</span>);
0693                 <span class="keyword">if</span> ~isempty(hff) &amp;&amp;  ishandle(hff)
0694                     figure(hff)
0695                     
0696                     <span class="comment">% Make the changes to figure</span>
0697                     set(gcf,<span class="string">'Color'</span>,BkgdColor);
0698                     set(gca,<span class="string">'FontSize'</span>,FntSize)
0699                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize)
0700                     set(gca,<span class="string">'Color'</span>,[0.3 0.3 0.3]) <span class="comment">%FigColor)</span>
0701                     set(gca,<span class="string">'XColor'</span>,AxColor)
0702                     set(gca,<span class="string">'YColor'</span>,AxColor)
0703                     set(gca,<span class="string">'ZColor'</span>,AxColor)
0704                     set(findobj(gcf,<span class="string">'tag'</span>,<span class="string">'Colorbar'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'XColor'</span>,AxColor,<span class="string">'YColor'</span>,AxColor);
0705                     set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0706                     set(get(gca,<span class="string">'xLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0707                     set(get(gca,<span class="string">'yLabel'</span>),<span class="string">'FontSize'</span>,FntSize,<span class="string">'Color'</span>,AxColor)
0708                     set(findobj(gca,<span class="string">'tag'</span>,<span class="string">'PlotBedElevation'</span>)   ,<span class="string">'color'</span>    ,AxColor)
0709                     set(findobj(gca,<span class="string">'tag'</span>,<span class="string">'ReferenceVectorText'</span>),<span class="string">'color'</span>    ,AxColor)
0710                 <span class="keyword">end</span>
0711             <span class="keyword">otherwise</span>
0712         <span class="keyword">end</span>
0713     <span class="keyword">end</span>
0714     
0715     
0716 <span class="keyword">end</span>
0717 
0718 <span class="comment">% [EOF] menuStylePresentation_Callback</span>
0719 
0720 
0721 <span class="comment">% --------------------------------------------------------------------</span>
0722 <a name="_sub31" href="#_subfunctions" class="code">function menuProcessingParameters_Callback(hObject, eventdata, handles)</a>
0723 <span class="comment">% Empty</span>
0724 
0725 <span class="comment">% --------------------------------------------------------------------</span>
0726 <a name="_sub32" href="#_subfunctions" class="code">function menuKMZExport_Callback(hObject, eventdata, handles)</a>
0727 
0728 <span class="comment">% Get the Application data:</span>
0729 <span class="comment">% -------------------------</span>
0730 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0731 
0732 <span class="comment">% Initialize the answer:</span>
0733 <span class="comment">% ----------------------</span>
0734 numstr = {num2str(guiparams.vertical_offset)};
0735 answer = NaN;
0736 <span class="keyword">while</span> isnan(answer)
0737     answer = inputdlg(<span class="string">'Vertical Offset (m)'</span>,<span class="string">'KMZ Export'</span>,1,numstr);
0738     
0739     <span class="keyword">if</span> isempty(answer) <span class="comment">% User hits &quot;Cancel&quot;</span>
0740         <span class="keyword">return</span>
0741     <span class="keyword">end</span>
0742     
0743     answer = str2double(answer); <span class="comment">% A non-numeric char will be NaN</span>
0744     <span class="comment">% A numeric char will be a double</span>
0745 <span class="keyword">end</span>
0746 
0747 <span class="comment">% Re-store the Application data:</span>
0748 <span class="comment">% ------------------------------</span>
0749 guiparams.vertical_offset = answer;
0750 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0751 
0752 <span class="comment">% [EOF] menuKMZExport_Callback</span>
0753 
0754 <span class="comment">% --------------------------------------------------------------------</span>
0755 <a name="_sub33" href="#_subfunctions" class="code">function menuBathymetryParameters_Callback(hObject, eventdata, handles)</a>
0756 <span class="comment">% Not implemented</span>
0757 
0758 <span class="comment">% --------------------------------------------------------------------</span>
0759 <a name="_sub34" href="#_subfunctions" class="code">function menuTools_Callback(hObject, eventdata, handles)</a>
0760 <span class="comment">% Empty</span>
0761 
0762 <span class="comment">% --------------------------------------------------------------------</span>
0763 <a name="_sub35" href="#_subfunctions" class="code">function menuASCII2GIS_Callback(hObject, eventdata, handles)</a>
0764 ASCII2GIS_GUI
0765 <span class="comment">% [EOF] menuASCII2GIS_Callback</span>
0766 
0767 <span class="comment">% --------------------------------------------------------------------</span>
0768 <a name="_sub36" href="#_subfunctions" class="code">function menuASCII2KML_Callback(hObject, eventdata, handles)</a>
0769 
0770 <span class="comment">% Get the Application preferences:</span>
0771 <span class="comment">% --------------------------------</span>
0772 guiprefs  = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0773 
0774 inpath = guiprefs.kmz_path;
0775 <span class="keyword">if</span> iscell(guiprefs.kmz_file)
0776     infile = guiprefs.kmz_file{1};
0777 <span class="keyword">else</span>
0778     infile = guiprefs.kmz_file;
0779 <span class="keyword">end</span>
0780 [log_text,outpath,outfile] = ASCII2KML(inpath,infile);
0781 
0782 guiprefs.kmz_path = outpath;
0783 guiprefs.kmz_file = outfile;
0784 
0785 <span class="comment">% Update persistent preferences</span>
0786 <span class="comment">% -----------------------------</span>
0787 setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
0788 
0789 <span class="comment">% [EOF] menuASCII2KML_Callback</span>
0790 
0791 <span class="comment">% --------------------------------------------------------------------</span>
0792 <a name="_sub37" href="#_subfunctions" class="code">function menuHelp_Callback(hObject, eventdata, handles)</a>
0793 <span class="comment">% Empty</span>
0794 
0795 <span class="comment">% --------------------------------------------------------------------</span>
0796 <a name="_sub38" href="#_subfunctions" class="code">function menuUsersGuide_Callback(hObject, eventdata, handles)</a>
0797 <span class="keyword">try</span>
0798     web(<span class="string">'http://code.google.com/p/velocity-mapping-tool/wiki/UserGuide?tm=6'</span>)
0799 <span class="keyword">catch</span> err <span class="comment">%#ok&lt;NASGU&gt;</span>
0800     h = errordlg(<span class="string">'No internet connectivity. Try again later.'</span>,<span class="keyword">...</span>
0801         <span class="string">'Online User Guide unavailable'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
0802 <span class="keyword">end</span>
0803 <span class="comment">% [EOF] menuASCII2KML_Callback</span>
0804 
0805 <span class="comment">% --------------------------------------------------------------------</span>
0806 <a name="_sub39" href="#_subfunctions" class="code">function menuFunctionLibrary_Callback(hObject, eventdata, handles)</a>
0807 <span class="comment">% Get the Application data:</span>
0808 <span class="comment">% -------------------------</span>
0809 <span class="comment">% guiparams = getappdata(handles.figure1,'guiparams'); %#ok&lt;NASGU&gt;</span>
0810 
0811 <span class="keyword">try</span>
0812     <span class="comment">% Construct a URL to a local file which can be interpreted by any</span>
0813     <span class="comment">% web-browser</span>
0814     rootpath = strrep(pwd,filesep,<span class="string">'/'</span>);
0815     web([<span class="string">'file:///'</span> rootpath <span class="string">'/doc/index.html'</span>]) <span class="comment">% Produced with m2html (FEX)</span>
0816 <span class="keyword">catch</span> err <span class="comment">%#ok&lt;NASGU&gt;</span>
0817     <span class="keyword">return</span>
0818 <span class="keyword">end</span>
0819 
0820 <span class="comment">% [EOF] menuFunctionLibrary_Callback</span>
0821 
0822 <span class="comment">% --------------------------------------------------------------------</span>
0823 <a name="_sub40" href="#_subfunctions" class="code">function menuCheckForUpdates_Callback(hObject, eventdata, handles)</a>
0824 
0825 <span class="comment">% Get the Application data:</span>
0826 <span class="comment">% -------------------------</span>
0827 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0828 
0829 <span class="comment">% Check version tag against the web, and display a message</span>
0830 <span class="keyword">try</span>
0831     current_vmt_version = urlread(<span class="string">'http://hydroacoustics.usgs.gov/movingboat/VMT/VMT_version.txt'</span>);
0832     <span class="comment">%     current_vmt_version = urlread('http://hydroacoustics.usgs.gov/movingboat/VMT/VMT_version.txt');</span>
0833 <span class="keyword">catch</span> err <span class="comment">%#ok&lt;NASGU&gt;</span>
0834     h = msgbox(<span class="string">'No internet connection. Try again later.'</span>,<span class="string">'Check for updates'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
0835     <span class="keyword">return</span>
0836 <span class="keyword">end</span>
0837 
0838 <span class="keyword">if</span> strcmpi(guiparams.vmt_version,current_vmt_version)
0839     h = msgbox(<span class="string">'VMT is currently up to date, no updates available.'</span>,<span class="string">'Check for updates'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
0840 <span class="keyword">else</span>
0841     h = msgbox(<span class="string">'VMT is out of date. Please visit the VMT homepage.'</span>,<span class="string">'Check for updates'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
0842 <span class="keyword">end</span>
0843 <span class="comment">% [EOF] menuCheckForUpdates_Callback</span>
0844 
0845 <span class="comment">% --------------------------------------------------------------------</span>
0846 <a name="_sub41" href="#_subfunctions" class="code">function menuAbout_Callback(hObject, eventdata, handles)</a>
0847 
0848 <span class="comment">% Get the Application data:</span>
0849 <span class="comment">% -------------------------</span>
0850 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0851 messagestr = <span class="keyword">...</span>
0852     {<span class="string">'The Velocity Mapping Toolbox'</span>;<span class="keyword">...</span>
0853     [<span class="string">'   Version: '</span> guiparams.vmt_version];<span class="keyword">...</span>
0854     <span class="string">''</span>;<span class="keyword">...</span>
0855     <span class="string">''</span>;<span class="keyword">...</span>
0856     <span class="string">'With collaborations from:'</span>;<span class="keyword">...</span>
0857     <span class="string">'   U.S. Geological Survey'</span>;<span class="keyword">...</span>
0858     <span class="string">'   University of Illinois'</span>;<span class="keyword">...</span>
0859     <span class="string">'   University of Hull'</span>;<span class="keyword">...</span>
0860     <span class="string">''</span>;<span class="keyword">...</span>
0861     <span class="string">''</span>;<span class="keyword">...</span>
0862     <span class="string">'Citation: '</span>;<span class="keyword">...</span>
0863     <span class="string">'   Parsons, D. R., Jackson, P. R., Czuba, J. A., Engel, F. L.,'</span>;<span class="keyword">...</span>
0864     <span class="string">'   Rhoads, B. L., Oberg, K. A., Best, J. L., Mueller, D. S.,'</span>;<span class="keyword">...</span>
0865     <span class="string">'   Johnson, K. K. and Riley, J. D. (2013), Velocity Mapping'</span>;<span class="keyword">...</span>
0866     <span class="string">'   Toolbox (VMT): a processing and visualization suite for'</span>;<span class="keyword">...</span>
0867     <span class="string">'   moving-vessel ADCP measurements. Earth Surf. Process.'</span>;<span class="keyword">...</span>
0868     <span class="string">'   Landforms.doi: 10.1002/esp.3367'</span>};
0869 h = msgbox(messagestr,<span class="string">'About VMT'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
0870 <span class="comment">% [EOF] menuAbout_Callback</span>
0871 
0872 
0873 
0874 
0875 <span class="comment">%%%%%%%%%%%%%%%%%%%%%</span>
0876 <span class="comment">% TOOLBAR CALLBACKS %</span>
0877 <span class="comment">%%%%%%%%%%%%%%%%%%%%%</span>
0878 
0879 <span class="comment">% --------------------------------------------------------------------</span>
0880 <a name="_sub42" href="#_subfunctions" class="code">function loadDataCallback(hObject, eventdata, handles)</a>
0881 <span class="comment">% Read Files into Data Structure using tfile.</span>
0882 
0883 <span class="comment">% Get the Application data:</span>
0884 <span class="comment">% -------------------------</span>
0885 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0886 guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0887 
0888 <span class="comment">% Ask the user to select files:</span>
0889 <span class="comment">% -----------------------------</span>
0890 current_file = fullfile(guiprefs.ascii_path,guiprefs.ascii_file{1});
0891 [filename,pathname] = uigetfile({<span class="string">'*_ASC.TXT'</span>,<span class="string">'ASCII (*_ASC.TXT)'</span>}, <span class="keyword">...</span>
0892     <span class="string">'Select the ASCII Output Files'</span>, <span class="keyword">...</span>
0893     current_file, <span class="keyword">...</span>
0894     <span class="string">'MultiSelect'</span>,<span class="string">'on'</span>);
0895 
0896 <span class="keyword">if</span> ischar(pathname) <span class="comment">% The user did not hit &quot;Cancel&quot;</span>
0897     guiparams.data_folder = pathname;
0898     <span class="keyword">if</span> ischar(filename)
0899         filename = {filename};
0900     <span class="keyword">end</span>
0901     guiparams.data_files = filename;
0902     guiparams.mat_file = <span class="string">''</span>;
0903     
0904     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0905     
0906    
0907     
0908     <span class="comment">% Update the preferences:</span>
0909     <span class="comment">% -----------------------</span>
0910     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
0911     guiprefs.ascii_path = pathname;
0912     guiprefs.ascii_file = filename;
0913     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
0914     <a href="#_sub85" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'ascii'</span>)
0915     
0916     <span class="comment">% Push messages to Log Window:</span>
0917     <span class="comment">% ----------------------------</span>
0918     log_text = {<span class="keyword">...</span>
0919         <span class="string">''</span>;<span class="keyword">...</span>
0920         [<span class="string">'%--- '</span> datestr(now) <span class="string">' ---%'</span>];<span class="keyword">...</span>
0921         <span class="string">'Current Project Directory:'</span>;<span class="keyword">...</span>
0922         guiparams.data_folder;
0923         <span class="string">'Loading the following files into memory:'</span>;<span class="keyword">...</span>
0924         char(filename)};
0925     statusLogging(handles.LogWindow, log_text)
0926     
0927     <span class="comment">% Read the file(s)</span>
0928     <span class="comment">% ----------------</span>
0929     [~,~,savefile,A,z] = <span class="keyword">...</span>
0930         <a href="VMT_ReadFiles.html" class="code" title="function [zPathName,zFileName,savefile,A,z] = VMT_ReadFiles(zPathName,zFileName)">VMT_ReadFiles</a>(guiparams.data_folder,guiparams.data_files);
0931     guiparams.savefile = savefile;
0932     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0933     
0934     <span class="comment">% Preprocess the data:</span>
0935     <span class="comment">% --------------------</span>
0936     A = <a href="VMT_PreProcess.html" class="code" title="function A = VMT_PreProcess(z,A)">VMT_PreProcess</a>(z,A);
0937     
0938     <span class="comment">% Push messages to Log Window:</span>
0939     <span class="comment">% ----------------------------</span>
0940     log_text = {<span class="keyword">...</span>
0941         <span class="string">'   Preprocessing complete.'</span>;<span class="keyword">...</span>
0942         <span class="string">'   Begin Data Processing...'</span>};
0943     statusLogging(handles.LogWindow, log_text)
0944     
0945     A(1).hgns = guiparams.horizontal_grid_node_spacing;
0946     A(1).wse  = guiparams.wse;  <span class="comment">%Set the WSE to entered value</span>
0947     [A,V,processing_log_text] = <a href="VMT_ProcessTransects.html" class="code" title="function [A,V,log_text] = VMT_ProcessTransects(z,A,setends)">VMT_ProcessTransects</a>(z,A,guiparams.set_cross_section_endpoints);
0948     
0949     <span class="comment">% Push messages to Log Window:</span>
0950     <span class="comment">% ----------------------------</span>
0951     statusLogging(handles.LogWindow, processing_log_text)
0952     
0953     <span class="comment">% Store the data:</span>
0954     <span class="comment">% ---------------</span>
0955     guiparams.z = z;
0956     guiparams.A = A;
0957     guiparams.V = V;
0958     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0959     
0960       
0961     <span class="comment">% Update the GUI:</span>
0962     <span class="comment">% ---------------</span>
0963     <a href="#_sub87" class="code" title="subfunction set_enable(handles,enable_state)">set_enable</a>(handles,<span class="string">'fileloaded'</span>)
0964 <span class="keyword">end</span>
0965 <span class="comment">% [EOF] loadDataCallback</span>
0966 
0967 
0968 
0969 <span class="comment">% --------------------------------------------------------------------</span>
0970 <a name="_sub43" href="#_subfunctions" class="code">function saveDataCallback(hObject, eventdata, handles)</a>
0971 <span class="comment">% SaveMATFile_Callback(handles.SaveMATFile,eventdata,handles)</span>
0972 
0973 <span class="comment">% Get the Application data:</span>
0974 <span class="comment">% -------------------------</span>
0975 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
0976 z   = guiparams.z;   <span class="comment">%#ok&lt;NASGU&gt;</span>
0977 A   = guiparams.A;   <span class="comment">%#ok&lt;NASGU&gt;</span>
0978 V   = guiparams.V;   <span class="comment">%#ok&lt;NASGU&gt;</span>
0979 Map = guiparams.Map; <span class="comment">%#ok&lt;NASGU&gt;</span>
0980 
0981 [the_file,the_path] = <span class="keyword">...</span>
0982     uiputfile({<span class="string">'*.mat'</span>,<span class="string">'MAT-Files (*.mat)'</span>}, <span class="keyword">...</span>
0983     <span class="string">'Save MAT-File'</span>, <span class="keyword">...</span>
0984     fullfile(guiparams.mat_path,guiparams.savefile));
0985 
0986 <span class="comment">% Save the processed data to a MAT file:</span>
0987 <span class="comment">% --------------------------------------</span>
0988 <span class="keyword">if</span> ischar(the_file)
0989     guiparams.mat_path = the_path;
0990     guiparams.mat_file = the_file;
0991     guiparams.savefile = the_file;
0992     
0993     <span class="comment">% Re-store the Application data:</span>
0994     <span class="comment">% ------------------------------</span>
0995     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
0996     
0997     <span class="comment">% Update the preferences:</span>
0998     <span class="comment">% -----------------------</span>
0999     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
1000     guiprefs.mat_path = the_path;
1001     guiprefs.mat_file = the_file;
1002     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
1003     <a href="#_sub85" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'mat'</span>)
1004     
1005     [pathstr,filename,extension] = fileparts([guiparams.mat_path guiparams.savefile]);
1006     savefile = fullfile(pathstr,[filename extension]);
1007     <span class="comment">%h = msgbox(['Saving processed data in MAT File ''' filename extension ''''], ...</span>
1008     <span class="comment">%    'Saving Processed Data File...'); %#ok&lt;NASGU&gt;</span>
1009     log_text = {<span class="keyword">...</span>
1010         <span class="string">'Saving Processed Data File...'</span>;<span class="keyword">...</span>
1011         savefile};
1012     statusLogging(handles.LogWindow,log_text)
1013     save(savefile,<span class="string">'A'</span>,<span class="string">'V'</span>,<span class="string">'z'</span>,<span class="string">'Map'</span>)
1014 <span class="keyword">end</span>
1015 
1016 <span class="comment">% [EOF] saveDataCallback</span>
1017 
1018 
1019 <span class="comment">% --------------------------------------------------------------------</span>
1020 <a name="_sub44" href="#_subfunctions" class="code">function saveBathymetryCallback(hObject, eventdata, handles)</a>
1021 
1022 <span class="comment">% Get the Application data:</span>
1023 <span class="comment">% -------------------------</span>
1024 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1025 z   = guiparams.z;
1026 A   = guiparams.A;
1027 <span class="comment">% V   = guiparams.V;   %#ok&lt;NASGU&gt;</span>
1028 <span class="comment">% Map = guiparams.Map; %#ok&lt;NASGU&gt;</span>
1029 
1030 <span class="comment">% Compute multibeam bathymetry:</span>
1031 <span class="comment">% -----------------------------</span>
1032 msgbox(<span class="string">'Processing Bathymetry...Please Be Patient'</span>,<span class="string">'VMT Status'</span>,<span class="string">'help'</span>,<span class="string">'replace'</span>)
1033 <span class="comment">%A = VMT_MBBathy(z,A,savefile,handles.beam_angle,handles.MagneticVariation,handles.WSE);</span>
1034 <a href="VMT_MBBathy.html" class="code" title="function [A] = VMT_MBBathy(z,A,savefile,beamAng,magVar,wsedata,saveaux)">VMT_MBBathy</a>(z,A,savefile, <span class="keyword">...</span>
1035     guiparams.beam_angle, <span class="keyword">...</span>
1036     guiparams.magnetic_variation, <span class="keyword">...</span>
1037     guiparams.wse, <span class="keyword">...</span>
1038     guiparams.output_auxiliary_data);
1039 
1040 msgbox(<span class="string">'Bathymetry Output Complete'</span>,<span class="string">'VMT Status'</span>,<span class="string">'help'</span>,<span class="string">'replace'</span>)
1041 
1042 <span class="comment">% [EOF] saveBathymetryCallback</span>
1043 
1044 <span class="comment">% --------------------------------------------------------------------</span>
1045 <a name="_sub45" href="#_subfunctions" class="code">function plottingParametersCallback(hObject, eventdata, handles)</a>
1046 
1047 <span class="comment">% Get the Application data:</span>
1048 <span class="comment">% -------------------------</span>
1049 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1050 
1051 [guiparams.english_units,guiparams.set_cross_section_endpoints,<span class="keyword">...</span>
1052     guiparams.presentation,guiparams.print] = <span class="keyword">...</span>
1053     plotParametersDialog(guiparams.english_units, <span class="keyword">...</span>
1054     guiparams.set_cross_section_endpoints,<span class="keyword">...</span>
1055     guiparams.presentation,guiparams.print,<span class="keyword">...</span>
1056     handles.figure1);
1057 
1058 <span class="comment">% Update the GUI:</span>
1059 <span class="comment">% ---------------</span>
1060 <span class="keyword">if</span> guiparams.english_units
1061     set(handles.menuMetric, <span class="string">'Checked'</span>,<span class="string">'off'</span>)
1062     set(handles.menuEnglish,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
1063 <span class="keyword">else</span>
1064     set(handles.menuMetric, <span class="string">'Checked'</span>,<span class="string">'on'</span>)
1065     set(handles.menuEnglish,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
1066 <span class="keyword">end</span>
1067 
1068 <span class="keyword">if</span> guiparams.set_cross_section_endpoints
1069     set(handles.menuCrossSectionEndpointAutomatic,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
1070     set(handles.menuCrossSectionEndpointManual,   <span class="string">'Checked'</span>,<span class="string">'on'</span>)
1071 <span class="keyword">else</span>
1072     set(handles.menuCrossSectionEndpointAutomatic,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
1073     set(handles.menuCrossSectionEndpointManual,   <span class="string">'Checked'</span>,<span class="string">'off'</span>)
1074 <span class="keyword">end</span>
1075 
1076 <span class="keyword">if</span> guiparams.presentation
1077     <a href="#_sub30" class="code" title="subfunction menuStylePresentation_Callback(hObject, eventdata, handles)">menuStylePresentation_Callback</a>(hObject, eventdata, handles)
1078 <span class="comment">%     set(handles.menuStylePrint,           'Checked','off')</span>
1079 <span class="comment">%     set(handles.menuStylePresentation,    'Checked','on')</span>
1080 <span class="comment">%     set(handles.menuPrintFormat,          'Checked','off')</span>
1081 <span class="comment">%     set(handles.menuPresentationFormat,   'Checked','on')</span>
1082 <span class="keyword">else</span>
1083     <a href="#_sub29" class="code" title="subfunction menuStylePrint_Callback(hObject, eventdata, handles)">menuStylePrint_Callback</a>(hObject, eventdata, handles)
1084 <span class="comment">%     set(handles.menuStylePrint,           'Checked','on')</span>
1085 <span class="comment">%     set(handles.menuStylePresentation,    'Checked','off')</span>
1086 <span class="comment">%     set(handles.menuPrintFormat,          'Checked','on')</span>
1087 <span class="comment">%     set(handles.menuPresentationFormat,   'Checked','off')</span>
1088 <span class="keyword">end</span>
1089 
1090 <span class="comment">% Re-store the Application data:</span>
1091 <span class="comment">% ------------------------------</span>
1092 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1093 
1094 <span class="comment">% [EOF] plottingParametersCallback</span>
1095 
1096 
1097 <span class="comment">% --------------------------------------------------------------------</span>
1098 <a name="_sub46" href="#_subfunctions" class="code">function processingParametersCallback(hObject, eventdata, handles)</a>
1099 
1100 <span class="comment">% Get the Application data:</span>
1101 <span class="comment">% -------------------------</span>
1102 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1103 z   = guiparams.z;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1104 A   = guiparams.A;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1105 V   = guiparams.V;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1106 Map = guiparams.Map; <span class="comment">%#ok&lt;NASGU&gt;</span>
1107 
1108 <span class="comment">% [EOF] processingParametersCallback</span>
1109 
1110 
1111 <span class="comment">% --------------------------------------------------------------------</span>
1112 <a name="_sub47" href="#_subfunctions" class="code">function shiptracksPlotCallback(hObject, eventdata, handles)</a>
1113 <span class="comment">% Plot 1</span>
1114 
1115 <span class="comment">% Get the Application data:</span>
1116 <span class="comment">% -------------------------</span>
1117 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1118 z = guiparams.z;
1119 A = guiparams.A;
1120 V = guiparams.V; <span class="comment">%#ok&lt;NASGU&gt;</span>
1121 <span class="comment">% Map = guiparams.Map;</span>
1122 setends = guiparams.set_cross_section_endpoints;
1123 
1124 <span class="comment">% Process the transects:</span>
1125 <span class="comment">% ----------------------</span>
1126 A(1).hgns = guiparams.horizontal_grid_node_spacing;
1127 A(1).wse  = guiparams.wse;  <span class="comment">%Set the WSE to entered value</span>
1128 [A,V,processing_log_text] = <a href="VMT_ProcessTransects.html" class="code" title="function [A,V,log_text] = VMT_ProcessTransects(z,A,setends)">VMT_ProcessTransects</a>(z,A,guiparams.set_cross_section_endpoints);
1129 
1130 <span class="comment">% Push messages to Log Window:</span>
1131 <span class="comment">% ----------------------------</span>
1132 log_text = {<span class="string">'Plotting Shiptracks (reprocessing)'</span>};
1133 statusLogging(handles.LogWindow, vertcat(log_text,processing_log_text))
1134 
1135 <span class="comment">% Create or replot the Shiptracks</span>
1136 <span class="comment">% -------------------------------</span>
1137 <span class="comment">% Grab the axes to the plot</span>
1138 <span class="comment">% axes(handles.Plot1Shiptracks);</span>
1139 <a href="VMT_PlotShiptracks.html" class="code" title="function hf = VMT_PlotShiptracks(A,V,z,setends,hf)">VMT_PlotShiptracks</a>(A,V,z,setends,handles.Plot1Shiptracks); <span class="comment">% PLOT 1</span>
1140 
1141 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1142 <span class="comment">% New plot display window</span>
1143 <span class="comment">% h = VMT_CreatePlotDisplay('shiptracks');</span>
1144 <span class="comment">% h = figure(1); clf</span>
1145 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1146 
1147 <span class="comment">% [EOF] shiptracksPlotCallback</span>
1148 
1149 
1150 <span class="comment">% --------------------------------------------------------------------</span>
1151 <a name="_sub48" href="#_subfunctions" class="code">function planviewPlotCallback(hObject, eventdata, handles)</a>
1152 <span class="comment">% Plot 2</span>
1153 
1154 <span class="comment">% Get the Application data:</span>
1155 <span class="comment">% -------------------------</span>
1156 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1157 
1158 <span class="keyword">if</span> iscell(guiparams.mat_file) <span class="comment">% Multiple MAT files loaded</span>
1159     <span class="comment">% Push messages to Log Window:</span>
1160     <span class="comment">% ----------------------------</span>
1161     log_text = {<span class="string">'Plotting Multiple Transects (Planview)'</span>};
1162     statusLogging(handles.LogWindow, log_text)
1163     
1164        
1165     <span class="comment">% Push plotting parameters to log window:</span>
1166     <span class="comment">% ---------------------------------------</span>
1167     log_text = {<span class="keyword">...</span>
1168         <span class="string">'Plan View Plotting Parameters'</span>;<span class="keyword">...</span>
1169         sprintf(<span class="string">'   Depth range %3.1f to %3.1f m'</span>,guiparams.depth_range_min, guiparams.depth_range_max);<span class="keyword">...</span>
1170         sprintf(<span class="string">'   Vector scale: %d'</span>,guiparams.vector_scale_plan_view);<span class="keyword">...</span>
1171         sprintf(<span class="string">'   Vector spacing: %d'</span>,guiparams.vector_spacing_plan_view);<span class="keyword">...</span>
1172         sprintf(<span class="string">'   Smoothing window size: %d'</span>,guiparams.smoothing_window_size);<span class="keyword">...</span>
1173         };
1174     statusLogging(handles.LogWindow, log_text)
1175     
1176     <span class="comment">% Plot the data:</span>
1177     <span class="comment">% --------------</span>
1178     z = [];
1179     A = [];
1180     V = [];
1181     Map = [];
1182     depth_range = [guiparams.depth_range_min guiparams.depth_range_max];
1183     [~,~,log_text] = <a href="VMT_PlotPlanViewQuivers.html" class="code" title="function [PVdata,fig_planview_handle,log_text] = VMT_PlotPlanViewQuivers(z,A,V,Map,drng,ascale,QuiverSpacing,pvsmwin,pshore,plot_english,varargin)">VMT_PlotPlanViewQuivers</a>(z,A,V,Map, <span class="keyword">...</span>
1184         depth_range, <span class="keyword">...</span>
1185         guiparams.vector_scale_plan_view, <span class="keyword">...</span>
1186         guiparams.vector_spacing_plan_view, <span class="keyword">...</span>
1187         guiparams.smoothing_window_size, <span class="keyword">...</span>
1188         guiparams.display_shoreline, <span class="keyword">...</span>
1189         guiparams.english_units, <span class="keyword">...</span>
1190         guiparams.mat_file, <span class="keyword">...</span>
1191         guiparams.mat_path); <span class="comment">% PLOT2</span>
1192     statusLogging(handles.LogWindow, log_text)
1193     
1194     <span class="comment">% Plot a Shoreline Map:</span>
1195     <span class="comment">% ---------------------</span>
1196     <span class="keyword">if</span> guiparams.display_shoreline
1197         Map = <a href="VMT_LoadMap.html" class="code" title="function Map = VMT_LoadMap(filetype,coord);">VMT_LoadMap</a>(<span class="string">'txt'</span>,<span class="string">'UTM'</span>);
1198         <span class="comment">%figure(2); clf</span>
1199         <a href="VMT_PlotShoreline.html" class="code" title="function VMT_PlotShoreline(Map)">VMT_PlotShoreline</a>(Map)
1200         log_text = {<span class="keyword">...</span>
1201             <span class="string">'   Loading map file.'</span>;<span class="keyword">...</span>
1202             <span class="string">'   Plotting shoreline.'</span><span class="keyword">...</span>
1203             };
1204         statusLogging(handles.LogWindow, log_text)
1205     <span class="keyword">else</span>
1206         Map = [];
1207     <span class="keyword">end</span>
1208     
1209 <span class="keyword">else</span>
1210     z = guiparams.z;
1211     A = guiparams.A;
1212     <span class="comment">% V = guiparams.V;</span>
1213     Map = guiparams.Map;
1214     
1215     <span class="comment">% Push messages to Log Window:</span>
1216     <span class="comment">% ----------------------------</span>
1217     log_text = {<span class="string">'Plotting Depth Averaged Vectors (reprocessing)'</span>};
1218     statusLogging(handles.LogWindow, log_text)
1219     
1220         
1221     <span class="comment">% Preprocess the data:</span>
1222     <span class="comment">% --------------------</span>
1223     A = <a href="VMT_PreProcess.html" class="code" title="function A = VMT_PreProcess(z,A)">VMT_PreProcess</a>(z,A);
1224     
1225     <span class="comment">% Process the transects:</span>
1226     <span class="comment">% ----------------------</span>
1227     A(1).hgns = guiparams.horizontal_grid_node_spacing;
1228     A(1).wse  = guiparams.wse;  <span class="comment">%Set the WSE to entered value</span>
1229     [A,V,processing_log_text] = <a href="VMT_ProcessTransects.html" class="code" title="function [A,V,log_text] = VMT_ProcessTransects(z,A,setends)">VMT_ProcessTransects</a>(z,A,guiparams.set_cross_section_endpoints);
1230     
1231     <span class="comment">% Push messages to Log Window:</span>
1232     <span class="comment">% ----------------------------</span>
1233     statusLogging(handles.LogWindow, processing_log_text)
1234     
1235     <span class="comment">% Plot the cross section:</span>
1236     <span class="comment">% -----------------------</span>
1237     log_text = {<span class="keyword">...</span>
1238         <span class="string">'Plan View Plotting Parameters'</span>;<span class="keyword">...</span>
1239         sprintf(<span class="string">'   Depth range %3.1f to %3.1f m'</span>,guiparams.depth_range_min, guiparams.depth_range_max);<span class="keyword">...</span>
1240         sprintf(<span class="string">'   Vector scale: %d'</span>,guiparams.vector_scale_plan_view);<span class="keyword">...</span>
1241         sprintf(<span class="string">'   Vector spacing: %d'</span>,guiparams.vector_spacing_plan_view);<span class="keyword">...</span>
1242         sprintf(<span class="string">'   Smoothing window size: %d'</span>,guiparams.smoothing_window_size);<span class="keyword">...</span>
1243         };
1244     statusLogging(handles.LogWindow, log_text)
1245     
1246     <span class="comment">% Plot the data:</span>
1247     <span class="comment">% --------------</span>
1248     <span class="comment">%msgbox('Plotting Plan View','VMT Status','help','replace');</span>
1249     depth_range = [guiparams.depth_range_min guiparams.depth_range_max];
1250     <span class="comment">% if ~guiparams.map_depth_averaged_velocities</span>
1251     
1252     [~,~,log_text] = <a href="VMT_PlotPlanViewQuivers.html" class="code" title="function [PVdata,fig_planview_handle,log_text] = VMT_PlotPlanViewQuivers(z,A,V,Map,drng,ascale,QuiverSpacing,pvsmwin,pshore,plot_english,varargin)">VMT_PlotPlanViewQuivers</a>(z,A,V,Map, <span class="keyword">...</span>
1253         depth_range, <span class="keyword">...</span>
1254         guiparams.vector_scale_plan_view, <span class="keyword">...</span>
1255         guiparams.vector_spacing_plan_view, <span class="keyword">...</span>
1256         guiparams.smoothing_window_size, <span class="keyword">...</span>
1257         guiparams.display_shoreline, <span class="keyword">...</span>
1258         guiparams.english_units); <span class="comment">% PLOT2</span>
1259     statusLogging(handles.LogWindow, log_text)
1260     
1261     <span class="comment">% Plot a Shoreline Map:</span>
1262     <span class="comment">% ---------------------</span>
1263     <span class="keyword">if</span> guiparams.display_shoreline
1264         Map = <a href="VMT_LoadMap.html" class="code" title="function Map = VMT_LoadMap(filetype,coord);">VMT_LoadMap</a>(<span class="string">'txt'</span>,<span class="string">'UTM'</span>);
1265         <span class="comment">%figure(2); clf</span>
1266         <a href="VMT_PlotShoreline.html" class="code" title="function VMT_PlotShoreline(Map)">VMT_PlotShoreline</a>(Map)
1267         log_text = {<span class="keyword">...</span>
1268             <span class="string">'   Loading map file.'</span>;<span class="keyword">...</span>
1269             <span class="string">'   Plotting shoreline.'</span><span class="keyword">...</span>
1270             };
1271         statusLogging(handles.LogWindow, log_text)
1272     <span class="keyword">else</span>
1273         Map = [];
1274     <span class="keyword">end</span>
1275     
1276 <span class="keyword">end</span>
1277 
1278 <span class="keyword">if</span> guiparams.add_background
1279     log_text = <a href="VMT_OverlayDOQQ.html" class="code" title="function log_text = VMT_OverlayDOQQ(pathname)">VMT_OverlayDOQQ</a>(guiparams.data_folder);
1280     statusLogging(handles.LogWindow, log_text)
1281 <span class="keyword">end</span>
1282 
1283 
1284 <span class="comment">% Force plot to be formated properly</span>
1285 <span class="comment">% ----------------------------------</span>
1286 <span class="keyword">if</span> guiparams.presentation
1287     <a href="#_sub30" class="code" title="subfunction menuStylePresentation_Callback(hObject, eventdata, handles)">menuStylePresentation_Callback</a>(hObject, eventdata, handles)
1288 <span class="keyword">else</span>
1289     <a href="#_sub29" class="code" title="subfunction menuStylePrint_Callback(hObject, eventdata, handles)">menuStylePrint_Callback</a>(hObject, eventdata, handles)
1290 <span class="keyword">end</span>
1291 
1292 <span class="comment">% [EOF] planviewPlotCallback</span>
1293 
1294 
1295 <span class="comment">% --------------------------------------------------------------------</span>
1296 <a name="_sub49" href="#_subfunctions" class="code">function crosssectionPlotCallback(hObject, eventdata, handles)</a>
1297 <span class="comment">% Plot 3</span>
1298 
1299 <span class="comment">% Get the Application data:</span>
1300 <span class="comment">% -------------------------</span>
1301 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1302 z = guiparams.z;
1303 A = guiparams.A;
1304 <span class="comment">% V = guiparams.V;</span>
1305 <span class="comment">% Map = guiparams.Map;</span>
1306 
1307 <span class="comment">% Preprocess the data:</span>
1308 <span class="comment">% --------------------</span>
1309 A = <a href="VMT_PreProcess.html" class="code" title="function A = VMT_PreProcess(z,A)">VMT_PreProcess</a>(z,A);
1310 
1311 <span class="comment">% Push messages to Log Window:</span>
1312 <span class="comment">% ----------------------------</span>
1313 log_text = {<span class="string">'Plotting Cross Section (reprocessing)'</span>};
1314 statusLogging(handles.LogWindow, log_text)
1315 
1316 <span class="comment">% Process the transects:</span>
1317 <span class="comment">% ----------------------</span>
1318 A(1).hgns = guiparams.horizontal_grid_node_spacing;
1319 A(1).wse  = guiparams.wse;  <span class="comment">%Set the WSE to entered value</span>
1320 [A,V,processing_log_text] = <a href="VMT_ProcessTransects.html" class="code" title="function [A,V,log_text] = VMT_ProcessTransects(z,A,setends)">VMT_ProcessTransects</a>(z,A,guiparams.set_cross_section_endpoints);
1321 
1322 <span class="comment">% Push messages to Log Window:</span>
1323 <span class="comment">% ----------------------------</span>
1324 statusLogging(handles.LogWindow, processing_log_text)
1325 
1326 <span class="comment">% Plot the cross section:</span>
1327 <span class="comment">% -----------------------</span>
1328 log_text = {<span class="keyword">...</span>
1329     <span class="string">'Cross Section Plotting Parameters'</span>;<span class="keyword">...</span>
1330     sprintf(<span class="string">'   Contour variable: %s'</span>          ,guiparams.contours(guiparams.idx_contour).string);<span class="keyword">...</span>
1331     sprintf(<span class="string">'   Vertical exaggeration: %d'</span>     ,guiparams.vertical_exaggeration);<span class="keyword">...</span>
1332     sprintf(<span class="string">'   Vector scale: %3.1f'</span>           ,guiparams.vector_scale_cross_section);<span class="keyword">...</span>
1333     sprintf(<span class="string">'   Horizontal vector spacing: %d'</span> ,guiparams.horizontal_vector_spacing);<span class="keyword">...</span>
1334     sprintf(<span class="string">'   Vertical vector spacing: %d'</span>   ,guiparams.vertical_vector_spacing);<span class="keyword">...</span>
1335     sprintf(<span class="string">'   Horizontal smooting window: %d'</span>,guiparams.horizontal_smoothing_window);<span class="keyword">...</span>
1336     sprintf(<span class="string">'   Vertical smoothing window: %d'</span> ,guiparams.vertical_smoothing_window);<span class="keyword">...</span>
1337     };
1338 <span class="keyword">if</span> guiparams.plot_secondary_flow_vectors
1339     log_text = vertcat(log_text, {<span class="keyword">...</span>
1340         sprintf(<span class="string">'   Vector variable: %s'</span>,guiparams.secondary_flows(guiparams.idx_secondary_flow_vector_variable).string);<span class="keyword">...</span>
1341         sprintf(<span class="string">'   Inc. vertical component?: %d'</span>,guiparams.include_vertical_velocity)<span class="keyword">...</span>
1342         });
1343 <span class="keyword">end</span>
1344 <span class="comment">% Push messages to Log Window:</span>
1345 <span class="comment">% ----------------------------</span>
1346 statusLogging(handles.LogWindow, log_text)
1347 
1348 <span class="keyword">if</span> guiparams.plot_secondary_flow_vectors
1349     <span class="comment">%msgbox('Plotting Cross Section','VMT Status','help','replace')</span>
1350     V = <a href="VMT_SmoothVar.html" class="code" title="function [V] = VMT_SmoothVar(V,hwin,vwin)">VMT_SmoothVar</a>(V, <span class="keyword">...</span>
1351         <span class="keyword">...</span><span class="comment">guiparams.contour, ...</span>
1352         guiparams.horizontal_smoothing_window, <span class="keyword">...</span>
1353         guiparams.vertical_smoothing_window);
1354     V = <a href="VMT_SmoothVar.html" class="code" title="function [V] = VMT_SmoothVar(V,hwin,vwin)">VMT_SmoothVar</a>(V, <span class="keyword">...</span>
1355         <span class="keyword">...</span><span class="comment">guiparams.secondary_flow_vector_variable, ...</span>
1356         guiparams.horizontal_smoothing_window, <span class="keyword">...</span>
1357         guiparams.vertical_smoothing_window);
1358     [~,A,V,plot_cont_log_text] = <a href="VMT_PlotXSContQuiver.html" class="code" title="function [z,A,V,log_text] = VMT_PlotXSContQuiver(z,A,V,var,sf,exag,qspchorz,qspcvert,secvecvar,vvelcomp,plot_english)">VMT_PlotXSContQuiver</a>(z,A,V, <span class="keyword">...</span>
1359         guiparams.contour, <span class="keyword">...</span>
1360         guiparams.vector_scale_cross_section, <span class="keyword">...</span>
1361         guiparams.vertical_exaggeration, <span class="keyword">...</span>
1362         guiparams.horizontal_vector_spacing, <span class="keyword">...</span>
1363         guiparams.vertical_vector_spacing, <span class="keyword">...</span>
1364         guiparams.secondary_flow_vector_variable, <span class="keyword">...</span>
1365         guiparams.include_vertical_velocity, <span class="keyword">...</span>
1366         guiparams.english_units); <span class="comment">%#ok&lt;ASGLU&gt; % PLOT3</span>
1367     
1368 <span class="keyword">elseif</span> ~guiparams.plot_secondary_flow_vectors
1369     V = <a href="VMT_SmoothVar.html" class="code" title="function [V] = VMT_SmoothVar(V,hwin,vwin)">VMT_SmoothVar</a>(V, <span class="keyword">...</span>
1370         <span class="keyword">...</span><span class="comment">guiparams.contour, ...</span>
1371         guiparams.horizontal_smoothing_window, <span class="keyword">...</span>
1372         guiparams.vertical_smoothing_window);
1373     
1374     [~,A,V,zmin,zmax,plot_cont_log_text] = <a href="VMT_PlotXSCont.html" class="code" title="function [z,A,V,zmin,zmax,log_text,fig_contour_handle] = VMT_PlotXSCont(z,A,V,var,exag,plot_english)">VMT_PlotXSCont</a>(z,A,V, <span class="keyword">...</span>
1375         guiparams.contour, <span class="keyword">...</span>
1376         guiparams.vertical_exaggeration, <span class="keyword">...</span>
1377         guiparams.english_units);  <span class="comment">%#ok&lt;ASGLU&gt;</span>
1378     
1379     guiparams.zmin = zmin;
1380     guiparams.zmax = zmax;
1381     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1382 <span class="keyword">end</span>
1383 
1384 <span class="comment">% Force plot to be formated properly</span>
1385 <span class="comment">% ----------------------------------</span>
1386 <span class="keyword">if</span> guiparams.presentation
1387     <a href="#_sub30" class="code" title="subfunction menuStylePresentation_Callback(hObject, eventdata, handles)">menuStylePresentation_Callback</a>(hObject, eventdata, handles)
1388 <span class="keyword">else</span>
1389     <a href="#_sub29" class="code" title="subfunction menuStylePrint_Callback(hObject, eventdata, handles)">menuStylePrint_Callback</a>(hObject, eventdata, handles)
1390 <span class="keyword">end</span>
1391 
1392 <span class="comment">% Push messages to Log Window:</span>
1393 <span class="comment">% ----------------------------</span>
1394 statusLogging(handles.LogWindow, plot_cont_log_text)
1395 <span class="comment">% msgbox('Plotting Complete','VMT Status','help','replace')</span>
1396 
1397 <span class="comment">% [EOF] crosssectionPlotCallback</span>
1398 
1399 
1400 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1401 <span class="comment">% DATA EXPORT CALLBACKS %</span>
1402 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1403 
1404 <span class="comment">% --------------------------------------------------------------------</span>
1405 <a name="_sub50" href="#_subfunctions" class="code">function SaveMATFile_Callback(hObject, eventdata, handles)</a>
1406 <span class="comment">% saveDataCallback(hObject, eventdata, handles)</span>
1407 
1408 <span class="comment">% Get the Application data:</span>
1409 <span class="comment">% -------------------------</span>
1410 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1411 z   = guiparams.z;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1412 A   = guiparams.A;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1413 V   = guiparams.V;   <span class="comment">%#ok&lt;NASGU&gt;</span>
1414 Map = guiparams.Map; <span class="comment">%#ok&lt;NASGU&gt;</span>
1415 
1416 [the_file,the_path] = <span class="keyword">...</span>
1417     uiputfile({<span class="string">'*.mat'</span>,<span class="string">'MAT-Files (*.mat)'</span>}, <span class="keyword">...</span>
1418     <span class="string">'Save MAT-File'</span>, <span class="keyword">...</span>
1419     fullfile(guiparams.mat_path,guiparams.savefile));
1420 
1421 <span class="comment">% Save the processed data to a MAT file:</span>
1422 <span class="comment">% --------------------------------------</span>
1423 <span class="keyword">if</span> ischar(the_file)
1424     guiparams.mat_path = the_path;
1425     guiparams.mat_file = the_file;
1426     guiparams.savefile = the_file;
1427     
1428     <span class="comment">% Re-store the Application data:</span>
1429     <span class="comment">% ------------------------------</span>
1430     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1431     
1432     <span class="comment">% Update the preferences:</span>
1433     <span class="comment">% -----------------------</span>
1434     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
1435     guiprefs.mat_path = the_path;
1436     guiprefs.mat_file = the_file;
1437     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
1438     <a href="#_sub85" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'mat'</span>)
1439     
1440     [~,filename,extension] = fileparts(guiparams.savefile);
1441     savefile = [filename extension];
1442     h = msgbox([<span class="string">'Saving processed data in MAT File '''</span> savefile <span class="string">''''</span>], <span class="keyword">...</span>
1443         <span class="string">'Saving Processed Data File...'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
1444     disp(<span class="string">'Saving Processed Data File...'</span>)
1445     disp(savefile)
1446     save(savefile,<span class="string">'A'</span>,<span class="string">'V'</span>,<span class="string">'z'</span>,<span class="string">'Map'</span>)
1447 <span class="keyword">end</span>
1448 
1449 <span class="comment">% [EOF] SaveMATFile_Callback</span>
1450 
1451 
1452 <span class="comment">% --------------------------------------------------------------------</span>
1453 <a name="_sub51" href="#_subfunctions" class="code">function SaveTecplotFile_Callback(hObject, eventdata, handles)</a>
1454 
1455 <span class="comment">% Get the Application data:</span>
1456 <span class="comment">% -------------------------</span>
1457 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1458 <span class="comment">% z   = guiparams.z;</span>
1459 <span class="comment">% A   = guiparams.A;</span>
1460 V   = guiparams.V;
1461 <span class="comment">% Map = guiparams.Map;</span>
1462 
1463 [the_file,the_path] = <span class="keyword">...</span>
1464     uiputfile({<span class="string">'*.dat'</span>,<span class="string">'Tecplot Files (*.dat)'</span>}, <span class="keyword">...</span>
1465     <span class="string">'Save Tecplot File'</span>, <span class="keyword">...</span>
1466     fullfile(guiparams.tecplot_path,guiparams.tecplot_file));
1467 
1468 <span class="comment">% Output the data (no smoothing) to Tecplot:</span>
1469 <span class="comment">% ------------------------------------------</span>
1470 <span class="keyword">if</span> ischar(the_file)
1471     guiparams.tecplot_path = the_path;
1472     guiparams.tecplot_file = the_file;
1473     
1474     <span class="comment">% Re-store the Application data:</span>
1475     <span class="comment">% ------------------------------</span>
1476     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1477     
1478     <span class="comment">% Update the preferences:</span>
1479     <span class="comment">% -----------------------</span>
1480     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
1481     guiprefs.tecplot_path = the_path;
1482     guiprefs.tecplot_file = the_file;
1483     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
1484     <a href="#_sub85" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'tecplot'</span>)
1485     
1486     <span class="comment">% Push to log window</span>
1487     <span class="comment">% ------------------</span>
1488     log_text = {<span class="keyword">...</span>
1489         <span class="string">'Exporting Data to Tecplot (*.dat) File...'</span>;<span class="keyword">...</span>
1490         <span class="string">'Directory:'</span>;<span class="keyword">...</span>
1491         the_path;<span class="keyword">...</span>
1492         [<span class="string">'Filename: '</span> the_file]};
1493     statusLogging(handles.LogWindow,log_text)
1494         
1495     <span class="keyword">if</span> isempty(V)
1496         A = guiparams.A;
1497         A(1).hgns = guiparams.horizontal_grid_node_spacing;
1498         A(1).wse  = guiparams.wse;  <span class="comment">%Set the WSE to entered value</span>
1499         [~,V] = VMT_ProcessTransectsV3_new(guiparams.z, <span class="keyword">...</span>
1500             A, <span class="keyword">...</span>
1501             guiparams.set_cross_section_endpoints);
1502     <span class="keyword">end</span>
1503     <a href="VMT_BuildTecplotFile.html" class="code" title="function VMT_BuildTecplotFile(V,savefile)">VMT_BuildTecplotFile</a>(V,fullfile(guiparams.tecplot_path,guiparams.tecplot_file));
1504     
1505     <span class="comment">% Push to log window</span>
1506     <span class="comment">% ------------------</span>
1507     log_text = {<span class="string">'Exporting XS Bathy Data to Tecplot (*.dat) File...'</span>};
1508     statusLogging(handles.LogWindow,log_text)
1509     
1510     <a href="VMT_BuildTecplotFile_XSBathy.html" class="code" title="function VMT_BuildTecplot_XSBathy(V,savefile)">VMT_BuildTecplotFile_XSBathy</a>(V,fullfile(guiparams.tecplot_path,guiparams.tecplot_file));
1511     
1512     <span class="comment">% Push to log window</span>
1513     <span class="comment">% ------------------</span>
1514     log_text = {<span class="string">'Tecplot Export Complete'</span>};
1515     statusLogging(handles.LogWindow,log_text)
1516    
1517 <span class="keyword">end</span>
1518 
1519 <span class="comment">% [EOF] SaveTechplotFile_Callback</span>
1520 
1521 
1522 <span class="comment">% --------------------------------------------------------------------</span>
1523 <a name="_sub52" href="#_subfunctions" class="code">function SaveGoogleEarthFile_Callback(hObject, eventdata, handles)</a>
1524 
1525 <span class="comment">% Get the Application data:</span>
1526 <span class="comment">% -------------------------</span>
1527 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1528 <span class="comment">% z   = guiparams.z;</span>
1529 A   = guiparams.A;
1530 V   = guiparams.V;
1531 Map = guiparams.Map; <span class="comment">%#ok&lt;NASGU&gt;</span>
1532 
1533 [the_file,the_path] = <span class="keyword">...</span>
1534     uiputfile({<span class="string">'*.kmz'</span>,<span class="string">'Google Earth Files (*.kmz)'</span>}, <span class="keyword">...</span>
1535     <span class="string">'Save Google Earth File'</span>, <span class="keyword">...</span>
1536     fullfile(guiparams.kmz_path,guiparams.kmz_file));
1537 
1538 <span class="comment">% Save the processed data to a Google Earth (KMZ) file:</span>
1539 <span class="comment">% -----------------------------------------------------</span>
1540 <span class="keyword">if</span> ischar(the_file)
1541     guiparams.kmz_path = the_path;
1542     guiparams.kmz_file = the_file;
1543     
1544     <span class="comment">% Re-store the Application data:</span>
1545     <span class="comment">% ------------------------------</span>
1546     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1547     
1548     <span class="comment">% Update the preferences:</span>
1549     <span class="comment">% -----------------------</span>
1550     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
1551     guiprefs.kmz_path = the_path;
1552     guiprefs.kmz_file = the_file;
1553     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
1554     <a href="#_sub85" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'kmz'</span>)
1555     
1556     <span class="comment">%     if guiparams.display_shoreline</span>
1557     <span class="comment">%         VMT_Shoreline2GE_3D(A,Map, ...</span>
1558     <span class="comment">%                             guiparams.vertical_exaggeration, ...</span>
1559     <span class="comment">%                             guiparams.vertical_offset);</span>
1560     <span class="comment">%     end</span>
1561     <span class="keyword">if</span> isempty(V)
1562         A = guiparams.A;
1563         A(1).hgns = guiparams.horizontal_grid_node_spacing;
1564         A(1).wse  = guiparams.wse;  <span class="comment">%Set the WSE to entered value</span>
1565         [~,V] = VMT_ProcessTransectsV3_new(guiparams.z, <span class="keyword">...</span>
1566             A, <span class="keyword">...</span>
1567             guiparams.set_cross_section_endpoints);
1568     <span class="keyword">end</span>
1569     <a href="VMT_MeanXS2GE_3D.html" class="code" title="function VMT_MeanXS2GE_3D(A,V,pathstr,filestr,vscale,voffset)">VMT_MeanXS2GE_3D</a>(A,V,[], <span class="keyword">...</span>
1570         fullfile(guiparams.kmz_path,guiparams.kmz_file), <span class="keyword">...</span>
1571         guiparams.vertical_exaggeration, <span class="keyword">...</span>
1572         guiparams.vertical_offset);
1573 <span class="keyword">end</span>
1574 
1575 <span class="comment">% [EOF] SaveGoogleEarthFile_Callback</span>
1576 
1577 
1578 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1579 <span class="comment">% DATA EXPORT/BATHYMETRY CALLBACKS %</span>
1580 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1581 
1582 <span class="comment">% --------------------------------------------------------------------</span>
1583 <a name="_sub53" href="#_subfunctions" class="code">function ExportMultibeamBathymetry_Callback(hObject, eventdata, handles)</a>
1584 
1585 <span class="comment">% Get the Application data:</span>
1586 <span class="comment">% -------------------------</span>
1587 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1588 guiprefs  = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
1589 
1590 [the_file,the_path] = <span class="keyword">...</span>
1591     uiputfile({<span class="string">'*.csv'</span>,<span class="string">'Multibeam Bathymetry Files (*.csv)'</span>}, <span class="keyword">...</span>
1592     <span class="string">'Export Multibeam Bathymetry'</span>, <span class="keyword">...</span>
1593     fullfile(guiprefs.multibeambathymetry_path, <span class="keyword">...</span>
1594     guiprefs.multibeambathymetry_file));
1595 
1596 <span class="keyword">if</span> ischar(the_file)
1597     guiparams.multibeambathymetry_path = the_path;
1598     guiparams.multibeambathymetry_file = the_file;
1599     
1600     <span class="comment">% Re-store the Application data:</span>
1601     <span class="comment">% ------------------------------</span>
1602     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1603     
1604     <span class="comment">% Update the preferences:</span>
1605     <span class="comment">% -----------------------</span>
1606     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
1607     guiprefs.multibeambathymetry_path = the_path;
1608     guiprefs.multibeambathymetry_file = the_file;
1609     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
1610     <a href="#_sub85" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'multibeambathymetry'</span>)
1611     
1612     <span class="keyword">if</span> guiparams.output_auxiliary_data
1613     <span class="keyword">end</span>
1614     
1615     <span class="comment">%msgbox('Processing Bathymetry...Please Be Patient','VMT Status','help','replace')</span>
1616     
1617     savefile = fullfile(guiparams.multibeambathymetry_path, <span class="keyword">...</span>
1618         guiparams.multibeambathymetry_file);
1619     
1620     log_text = {<span class="string">'Multibeam bathymetry file saved to:'</span>;<span class="keyword">...</span>
1621         [<span class="string">'   '</span> savefile]};
1622     statusLogging(handles.LogWindow,log_text)
1623     
1624     <a href="VMT_MBBathy.html" class="code" title="function [A] = VMT_MBBathy(z,A,savefile,beamAng,magVar,wsedata,saveaux)">VMT_MBBathy</a>(guiparams.z, <span class="keyword">...</span>
1625         guiparams.A, <span class="keyword">...</span>
1626         savefile, <span class="keyword">...</span>
1627         guiparams.beam_angle, <span class="keyword">...</span>
1628         guiparams.magnetic_variation, <span class="keyword">...</span>
1629         guiparams.wse, <span class="keyword">...</span>
1630         guiparams.output_auxiliary_data);
1631     
1632     <span class="comment">%msgbox('Bathymetry Output Complete','VMT Status','help','replace')</span>
1633     
1634 <span class="keyword">end</span>
1635 
1636 <span class="comment">% [EOF] ExportMultibeamBathymetry_Callback</span>
1637 
1638 
1639 <span class="comment">% --------------------------------------------------------------------</span>
1640 <a name="_sub54" href="#_subfunctions" class="code">function BeamAngle_Callback(hObject, eventdata, handles)</a>
1641 <span class="comment">% Get the beam angle</span>
1642 
1643 <span class="comment">% Get the Application data:</span>
1644 <span class="comment">% -------------------------</span>
1645 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1646 
1647 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1648 <span class="comment">% ----------------------------------------------------------------</span>
1649 new_beam_angle = str2double(get(hObject,<span class="string">'String'</span>));
1650 is_a_number = ~isnan(new_beam_angle);
1651 is_positive = new_beam_angle&gt;=0;
1652 
1653 <span class="comment">% Modify the Application data:</span>
1654 <span class="comment">% ----------------------------</span>
1655 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1656     guiparams.beam_angle = new_beam_angle;
1657     
1658     <span class="comment">% Re-store the Application data:</span>
1659     <span class="comment">% ------------------------------</span>
1660     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1661     
1662 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1663     set(hObject,<span class="string">'String'</span>,guiparams.beam_angle)
1664 <span class="keyword">end</span>
1665 
1666 <span class="comment">% [EOF] BeamAngle_Callback</span>
1667 
1668 
1669 <span class="comment">% --------------------------------------------------------------------</span>
1670 <a name="_sub55" href="#_subfunctions" class="code">function MagneticVariation_Callback(hObject, eventdata, handles)</a>
1671 <span class="comment">% Get the Magnetic Variation</span>
1672 
1673 <span class="comment">% Get the Application data:</span>
1674 <span class="comment">% -------------------------</span>
1675 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1676 
1677 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1678 <span class="comment">% ----------------------------------------------------------------</span>
1679 new_magnetic_variation = str2double(get(hObject,<span class="string">'String'</span>));
1680 is_a_number = ~isnan(new_magnetic_variation);
1681 is_positive = new_magnetic_variation&gt;=0;
1682 
1683 <span class="comment">% Modify the Application data:</span>
1684 <span class="comment">% ----------------------------</span>
1685 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1686     guiparams.magnetic_variation = new_magnetic_variation;
1687     
1688     <span class="comment">% Re-store the Application data:</span>
1689     <span class="comment">% ------------------------------</span>
1690     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1691     
1692 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1693     set(hObject,<span class="string">'String'</span>,guiparams.magnetic_variation)
1694 <span class="keyword">end</span>
1695 
1696 <span class="comment">% [EOF] MagneticVariation_Callback</span>
1697 
1698 
1699 <span class="comment">% --------------------------------------------------------------------</span>
1700 <a name="_sub56" href="#_subfunctions" class="code">function WSE_Callback(hObject, eventdata, handles)</a>
1701 
1702 <span class="comment">% Get the Application data:</span>
1703 <span class="comment">% -------------------------</span>
1704 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1705 
1706 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1707 <span class="comment">% ----------------------------------------------------------------</span>
1708 new_wse = str2double(get(hObject,<span class="string">'String'</span>));
1709 is_a_number = ~isnan(new_wse);
1710 is_positive = new_wse&gt;=0;
1711 
1712 <span class="comment">% Modify the Application data:</span>
1713 <span class="comment">% ----------------------------</span>
1714 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1715     guiparams.wse = new_wse;
1716     
1717     <span class="comment">% Re-store the Application data:</span>
1718     <span class="comment">% ------------------------------</span>
1719     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1720     
1721 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1722     set(hObject,<span class="string">'String'</span>,guiparams.wse)
1723 <span class="keyword">end</span>
1724 
1725 <span class="comment">% [EOF] WSE_Callback</span>
1726 
1727 
1728 <span class="comment">% --------------------------------------------------------------------</span>
1729 <a name="_sub57" href="#_subfunctions" class="code">function OutputAuxiliaryData_Callback(hObject, eventdata, handles)</a>
1730 <span class="comment">% Bathymetry Auxillary Data</span>
1731 
1732 <span class="comment">% Get the Application data:</span>
1733 <span class="comment">% -------------------------</span>
1734 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1735 
1736 <span class="comment">% Modify the Application data:</span>
1737 <span class="comment">% ----------------------------</span>
1738 guiparams.output_auxiliary_data = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
1739 
1740 <span class="comment">% Re-store the Application data:</span>
1741 <span class="comment">% ------------------------------</span>
1742 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1743 
1744 <span class="comment">% [EOF] OutputAuxiliaryData_Callback</span>
1745 
1746 
1747 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1748 <span class="comment">% PLOTTING/PLAN VIEW PLOT CALLBACKS %</span>
1749 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1750 
1751 <span class="comment">% --------------------------------------------------------------------</span>
1752 <a name="_sub58" href="#_subfunctions" class="code">function DepthRangeMin_Callback(hObject, eventdata, handles)</a>
1753 
1754 <span class="comment">% Get the Application data:</span>
1755 <span class="comment">% -------------------------</span>
1756 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1757 
1758 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1759 <span class="comment">% ----------------------------------------------------------------</span>
1760 new_depth_range_min = str2double(get(hObject,<span class="string">'String'</span>));
1761 is_a_number = ~isnan(new_depth_range_min);
1762 is_positive = new_depth_range_min&gt;=0;
1763 
1764 <span class="comment">% Modify the Application data:</span>
1765 <span class="comment">% ----------------------------</span>
1766 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1767     guiparams.depth_range_min = new_depth_range_min;
1768     
1769     <span class="comment">% Re-store the Application data:</span>
1770     <span class="comment">% ------------------------------</span>
1771     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1772     
1773 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1774     set(hObject,<span class="string">'String'</span>,guiparams.depth_range_min)
1775 <span class="keyword">end</span>
1776 
1777 <span class="comment">% [EOF] DepthRangeMin_Callback</span>
1778 
1779 
1780 <span class="comment">% --------------------------------------------------------------------</span>
1781 <a name="_sub59" href="#_subfunctions" class="code">function DepthRangeMax_Callback(hObject, eventdata, handles)</a>
1782 
1783 <span class="comment">% Get the Application data:</span>
1784 <span class="comment">% -------------------------</span>
1785 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1786 
1787 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1788 <span class="comment">% ----------------------------------------------------------------</span>
1789 new_depth_range_max = str2double(get(hObject,<span class="string">'String'</span>));
1790 is_a_number = ~isnan(new_depth_range_max);
1791 is_positive = new_depth_range_max&gt;=0;
1792 
1793 <span class="comment">% Modify the Application data:</span>
1794 <span class="comment">% ----------------------------</span>
1795 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1796     guiparams.depth_range_max = new_depth_range_max;
1797     
1798     <span class="comment">% Re-store the Application data:</span>
1799     <span class="comment">% ------------------------------</span>
1800     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1801     
1802 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1803     set(hObject,<span class="string">'String'</span>,guiparams.depth_range_max)
1804 <span class="keyword">end</span>
1805 
1806 <span class="comment">% [EOF] DepthMax_Callback</span>
1807 
1808 
1809 <span class="comment">% --------------------------------------------------------------------</span>
1810 <a name="_sub60" href="#_subfunctions" class="code">function VectorScalePlanView_Callback(hObject, eventdata, handles)</a>
1811 <span class="comment">% Set quiver scale (contour)</span>
1812 
1813 <span class="comment">% Get the Application data:</span>
1814 <span class="comment">% -------------------------</span>
1815 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1816 
1817 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1818 <span class="comment">% ----------------------------------------------------------------</span>
1819 new_vector_scale_plan_view = str2double(get(hObject,<span class="string">'String'</span>));
1820 is_a_number = ~isnan(new_vector_scale_plan_view);
1821 is_positive = new_vector_scale_plan_view&gt;=0;
1822 
1823 <span class="comment">% Modify the Application data:</span>
1824 <span class="comment">% ----------------------------</span>
1825 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1826     guiparams.vector_scale_plan_view = round(new_vector_scale_plan_view);
1827     
1828     <span class="comment">% Re-store the Application data:</span>
1829     <span class="comment">% ------------------------------</span>
1830     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1831     
1832 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1833     set(hObject,<span class="string">'String'</span>,guiparams.vector_scale_plan_view)
1834 <span class="keyword">end</span>
1835 
1836 <span class="comment">% [EOF] VectorScalePlanView_Callback</span>
1837 
1838 
1839 <span class="comment">% --------------------------------------------------------------------</span>
1840 <a name="_sub61" href="#_subfunctions" class="code">function VectorSpacingPlanview_Callback(hObject, eventdata, handles)</a>
1841 <span class="comment">% Set quiver spacing (contour, horizontal)</span>
1842 
1843 <span class="comment">% Get the Application data:</span>
1844 <span class="comment">% -------------------------</span>
1845 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1846 
1847 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1848 <span class="comment">% ----------------------------------------------------------------</span>
1849 new_vector_spacing_plan_view = str2double(get(hObject,<span class="string">'String'</span>));
1850 is_a_number = ~isnan(new_vector_spacing_plan_view);
1851 is_positive = new_vector_spacing_plan_view&gt;=0;
1852 
1853 <span class="comment">% Modify the Application data:</span>
1854 <span class="comment">% ----------------------------</span>
1855 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1856     guiparams.vector_spacing_plan_view = round(new_vector_spacing_plan_view);
1857     
1858     <span class="comment">% Re-store the Application data:</span>
1859     <span class="comment">% ------------------------------</span>
1860     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1861     
1862 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1863     set(hObject,<span class="string">'String'</span>,guiparams.vector_spacing_plan_view)
1864 <span class="keyword">end</span>
1865 
1866 <span class="comment">% [EOF] VectorSpacingPlanview_Callback</span>
1867 
1868 
1869 <span class="comment">% --------------------------------------------------------------------</span>
1870 <a name="_sub62" href="#_subfunctions" class="code">function SmoothingWindowSize_Callback(hObject, eventdata, handles)</a>
1871 <span class="comment">% Plan View smoothing window size</span>
1872 
1873 <span class="comment">% Get the Application data:</span>
1874 <span class="comment">% -------------------------</span>
1875 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1876 
1877 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1878 <span class="comment">% ----------------------------------------------------------------</span>
1879 new_smoothing_window_size = str2double(get(hObject,<span class="string">'String'</span>));
1880 is_a_number = ~isnan(new_smoothing_window_size);
1881 is_positive = new_smoothing_window_size&gt;=0;
1882 
1883 <span class="comment">% Modify the Application data:</span>
1884 <span class="comment">% ----------------------------</span>
1885 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1886     guiparams.smoothing_window_size = round(new_smoothing_window_size);
1887     
1888     <span class="comment">% Re-store the Application data:</span>
1889     <span class="comment">% ------------------------------</span>
1890     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1891     
1892 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1893     set(hObject,<span class="string">'String'</span>,guiparams.smoothing_window_size)
1894 <span class="keyword">end</span>
1895 
1896 <span class="comment">% [EOF] SmoothingWindowSize_Callback</span>
1897 
1898 
1899 <span class="comment">% --------------------------------------------------------------------</span>
1900 <a name="_sub63" href="#_subfunctions" class="code">function MapDepthAveragedVelocities_Callback(hObject, eventdata, handles)</a>
1901 
1902 <span class="comment">% Get the Application data:</span>
1903 <span class="comment">% -------------------------</span>
1904 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1905 
1906 <span class="comment">% Modify the Application data:</span>
1907 <span class="comment">% ----------------------------</span>
1908 guiparams.map_depth_averaged_velocities = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
1909 
1910 <span class="comment">% Re-store the Application data:</span>
1911 <span class="comment">% ------------------------------</span>
1912 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1913 
1914 <span class="comment">% [EOF] MapDepthAveragedVelocities_Callback</span>
1915 
1916 
1917 <span class="comment">% --------------------------------------------------------------------</span>
1918 <a name="_sub64" href="#_subfunctions" class="code">function DisplayShoreline_Callback(hObject, eventdata, handles)</a>
1919 
1920 <span class="comment">% Get the Application data:</span>
1921 <span class="comment">% -------------------------</span>
1922 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1923 
1924 <span class="comment">% Modify the Application data:</span>
1925 <span class="comment">% ----------------------------</span>
1926 guiparams.display_shoreline = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
1927 
1928 <span class="comment">% Re-store the Application data:</span>
1929 <span class="comment">% ------------------------------</span>
1930 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1931 
1932 <span class="comment">% [EOF] DisplayShoreline_Callback</span>
1933 
1934 
1935 <span class="comment">% --------------------------------------------------------------------</span>
1936 <a name="_sub65" href="#_subfunctions" class="code">function AddBackground_Callback(hObject, eventdata, handles)</a>
1937 
1938 <span class="comment">% Get the Application data:</span>
1939 <span class="comment">% -------------------------</span>
1940 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1941 
1942 <span class="comment">% Modify the Application data:</span>
1943 <span class="comment">% ----------------------------</span>
1944 guiparams.add_background = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
1945 
1946 <span class="comment">% Re-store the Application data:</span>
1947 <span class="comment">% ------------------------------</span>
1948 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1949 
1950 <span class="comment">% [EOF] AddBackground_Callback</span>
1951 
1952 
1953 <span class="comment">% --------------------------------------------------------------------</span>
1954 <a name="_sub66" href="#_subfunctions" class="code">function PlotPlanView_Callback(hObject, eventdata, handles)</a>
1955 <a href="#_sub48" class="code" title="subfunction planviewPlotCallback(hObject, eventdata, handles)">planviewPlotCallback</a>(hObject, eventdata, handles)
1956 <span class="comment">% [EOF] PlotPlanView_Callback</span>
1957 
1958 
1959 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1960 <span class="comment">% PLOTTING/SHIP TRACKS PLOT CALLBACKS %</span>
1961 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
1962 
1963 <span class="comment">% --------------------------------------------------------------------</span>
1964 <a name="_sub67" href="#_subfunctions" class="code">function HorizontalGridNodeSpacing_Callback(hObject, eventdata, handles)</a>
1965 <span class="comment">% Set the horizontal grid node spacing</span>
1966 
1967 <span class="comment">% Get the Application data:</span>
1968 <span class="comment">% -------------------------</span>
1969 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
1970 
1971 <span class="comment">% Get the new entry and make sure it is valid (numeric, positive):</span>
1972 <span class="comment">% ----------------------------------------------------------------</span>
1973 new_horizontal_grid_node_spacing = str2double(get(hObject,<span class="string">'String'</span>));
1974 is_a_number = ~isnan(new_horizontal_grid_node_spacing);
1975 is_positive = new_horizontal_grid_node_spacing&gt;=0;
1976 
1977 <span class="comment">% Modify the Application data:</span>
1978 <span class="comment">% ----------------------------</span>
1979 <span class="keyword">if</span> is_a_number &amp;&amp; is_positive
1980     guiparams.horizontal_grid_node_spacing = round(new_horizontal_grid_node_spacing);
1981     
1982     <span class="comment">% Re-store the Application data:</span>
1983     <span class="comment">% ------------------------------</span>
1984     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
1985     
1986 <span class="keyword">else</span> <span class="comment">% Reject the (incorrect) input</span>
1987     set(hObject,<span class="string">'String'</span>,guiparams.horizontal_grid_node_spacing)
1988 <span class="keyword">end</span>
1989 
1990 <span class="comment">% [EOF] HorizontalGridNodeSpacing_Callback</span>
1991 
1992 
1993 <span class="comment">% --------------------------------------------------------------------</span>
1994 <a name="_sub68" href="#_subfunctions" class="code">function SetCrossSectionEndpoints_Callback(hObject, eventdata, handles)</a>
1995 <span class="comment">% Set the cross section endpoints manually</span>
1996 
1997 <span class="comment">% Get the Application data:</span>
1998 <span class="comment">% -------------------------</span>
1999 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2000 
2001 <span class="comment">% Modify the Application data:</span>
2002 <span class="comment">% ----------------------------</span>
2003 guiparams.set_cross_section_endpoints = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
2004 
2005 <span class="comment">% Re-store the Application data:</span>
2006 <span class="comment">% ------------------------------</span>
2007 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2008 
2009 <span class="comment">% [EOF] SetCrossSectionEndpoints_Callback</span>
2010 
2011 
2012 <span class="comment">% --------------------------------------------------------------------</span>
2013 <a name="_sub69" href="#_subfunctions" class="code">function PlotShiptracks_Callback(hObject, eventdata, handles)</a>
2014 <a href="#_sub47" class="code" title="subfunction shiptracksPlotCallback(hObject, eventdata, handles)">shiptracksPlotCallback</a>(hObject, eventdata, handles)
2015 <span class="comment">% [EOF] PlotShiptracks_Callback</span>
2016 
2017 
2018 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
2019 <span class="comment">% PLOTTING/CROSS SECTION PLOT CALLBACKS %</span>
2020 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
2021 
2022 <span class="comment">% --------------------------------------------------------------------</span>
2023 <a name="_sub70" href="#_subfunctions" class="code">function Contour_Callback(hObject, eventdata, handles)</a>
2024 
2025 <span class="comment">% Get the Application data:</span>
2026 <span class="comment">% -------------------------</span>
2027 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2028 
2029 <span class="comment">% Modify the Application data:</span>
2030 <span class="comment">% ----------------------------</span>
2031 idx_variable = get(hObject,<span class="string">'Value'</span>);
2032 guiparams.idx_contour = idx_variable;
2033 guiparams.contour = guiparams.contours(idx_variable).variable;
2034 
2035 <span class="comment">% Re-store the Application data:</span>
2036 <span class="comment">% ------------------------------</span>
2037 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2038 
2039 <span class="comment">% [EOF] Contour_Callback</span>
2040 
2041 
2042 <span class="comment">% --------------------------------------------------------------------</span>
2043 <a name="_sub71" href="#_subfunctions" class="code">function VerticalExaggeration_Callback(hObject, eventdata, handles)</a>
2044 <span class="comment">% Set vertical exaggeration</span>
2045 
2046 <span class="comment">% Get the Application data:</span>
2047 <span class="comment">% -------------------------</span>
2048 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2049 
2050 <span class="comment">% Modify the Application data:</span>
2051 <span class="comment">% ----------------------------</span>
2052 guiparams.vertical_exaggeration = str2double(get(hObject,<span class="string">'String'</span>));
2053 
2054 <span class="comment">% Re-store the Application data:</span>
2055 <span class="comment">% ------------------------------</span>
2056 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2057 
2058 <span class="comment">% Update the GUI:</span>
2059 <span class="comment">% ---------------</span>
2060 <span class="comment">% updateGUI(handles,guiparams)</span>
2061 
2062 <span class="comment">% [EOF] VerticalExaggeration_Callback</span>
2063 
2064 
2065 <span class="comment">% --------------------------------------------------------------------</span>
2066 <a name="_sub72" href="#_subfunctions" class="code">function VectorScaleCrossSection_Callback(hObject, eventdata, handles)</a>
2067 
2068 <span class="comment">% Get the Application data:</span>
2069 <span class="comment">% -------------------------</span>
2070 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2071 
2072 <span class="comment">% Modify the Application data:</span>
2073 <span class="comment">% ----------------------------</span>
2074 guiparams.vector_scale_cross_section = str2double(get(hObject,<span class="string">'String'</span>));
2075 
2076 <span class="comment">% Re-store the Application data:</span>
2077 <span class="comment">% ------------------------------</span>
2078 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2079 
2080 <span class="comment">% Update the GUI:</span>
2081 <span class="comment">% ---------------</span>
2082 <span class="comment">% updateGUI(handles,guiparams)</span>
2083 
2084 <span class="comment">% [EOF] VectorScaleCrossSection_Callback</span>
2085 
2086 
2087 <span class="comment">% --------------------------------------------------------------------</span>
2088 <a name="_sub73" href="#_subfunctions" class="code">function HorizontalVectorSpacing_Callback(hObject, eventdata, handles)</a>
2089 
2090 <span class="comment">% Get the Application data:</span>
2091 <span class="comment">% -------------------------</span>
2092 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2093 
2094 <span class="comment">% Modify the Application data:</span>
2095 <span class="comment">% ----------------------------</span>
2096 guiparams.horizontal_vector_spacing = str2double(get(hObject,<span class="string">'String'</span>));
2097 
2098 <span class="comment">% Re-store the Application data:</span>
2099 <span class="comment">% ------------------------------</span>
2100 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2101 
2102 <span class="comment">% Update the GUI:</span>
2103 <span class="comment">% ---------------</span>
2104 <span class="comment">% updateGUI(handles,guiparams)</span>
2105 
2106 <span class="comment">% [EOF] HorizontalVectorSpacing_Callback</span>
2107 
2108 
2109 <span class="comment">% --------------------------------------------------------------------</span>
2110 <a name="_sub74" href="#_subfunctions" class="code">function VerticalVectorSpacing_Callback(hObject, eventdata, handles)</a>
2111 <span class="comment">% Get the vertical quiver spacing for contour plots</span>
2112 
2113 <span class="comment">% Get the Application data:</span>
2114 <span class="comment">% -------------------------</span>
2115 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2116 
2117 <span class="comment">% Modify the Application data:</span>
2118 <span class="comment">% ----------------------------</span>
2119 guiparams.vertical_vector_spacing = str2double(get(hObject,<span class="string">'String'</span>));
2120 
2121 <span class="comment">% Re-store the Application data:</span>
2122 <span class="comment">% ------------------------------</span>
2123 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2124 
2125 <span class="comment">% Update the GUI:</span>
2126 <span class="comment">% ---------------</span>
2127 <span class="comment">% updateGUI(handles,guiparams)</span>
2128 
2129 <span class="comment">% [EOF] VerticalVectorSpacing_Callback</span>
2130 
2131 
2132 <span class="comment">% --------------------------------------------------------------------</span>
2133 <a name="_sub75" href="#_subfunctions" class="code">function HorizontalSmoothingWindow_Callback(hObject, eventdata, handles)</a>
2134 <span class="comment">% Horizontal Smoothing</span>
2135 
2136 <span class="comment">% Get the Application data:</span>
2137 <span class="comment">% -------------------------</span>
2138 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2139 
2140 <span class="comment">% Modify the Application data:</span>
2141 <span class="comment">% ----------------------------</span>
2142 guiparams.horizontal_smoothing_window = str2double(get(hObject,<span class="string">'String'</span>));
2143 
2144 <span class="comment">% Re-store the Application data:</span>
2145 <span class="comment">% ------------------------------</span>
2146 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2147 
2148 <span class="comment">% Update the GUI:</span>
2149 <span class="comment">% ---------------</span>
2150 <span class="comment">% updateGUI(handles,guiparams)</span>
2151 
2152 <span class="comment">% [EOF] HorizontalSmoothingWindow_Callback</span>
2153 
2154 
2155 <span class="comment">% --------------------------------------------------------------------</span>
2156 <a name="_sub76" href="#_subfunctions" class="code">function VerticalSmoothingWindow_Callback(hObject, eventdata, handles)</a>
2157 <span class="comment">% Vertical Smoothing</span>
2158 
2159 <span class="comment">% Get the Application data:</span>
2160 <span class="comment">% -------------------------</span>
2161 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2162 
2163 <span class="comment">% Modify the Application data:</span>
2164 <span class="comment">% ----------------------------</span>
2165 guiparams.vertical_smoothing_window = str2double(get(hObject,<span class="string">'String'</span>));
2166 
2167 <span class="comment">% Re-store the Application data:</span>
2168 <span class="comment">% ------------------------------</span>
2169 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2170 
2171 <span class="comment">% Update the GUI:</span>
2172 <span class="comment">% ---------------</span>
2173 <span class="comment">% updateGUI(handles,guiparams)</span>
2174 
2175 <span class="comment">% [EOF] VerticalSmoothingWindow_Callback</span>
2176 
2177 
2178 <span class="comment">% --------------------------------------------------------------------</span>
2179 <a name="_sub77" href="#_subfunctions" class="code">function PlotSecondaryFlowVectors_Callback(hObject, eventdata, handles)</a>
2180 
2181 <span class="comment">% Get the Application data:</span>
2182 <span class="comment">% -------------------------</span>
2183 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2184 
2185 <span class="comment">% Modify the Application data:</span>
2186 <span class="comment">% ----------------------------</span>
2187 guiparams.plot_secondary_flow_vectors = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
2188 
2189 <span class="comment">% Re-store the Application data:</span>
2190 <span class="comment">% ------------------------------</span>
2191 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2192 
2193 <span class="comment">% [EOF] PlotSecondaryFlowVectors_Callback</span>
2194 
2195 
2196 <span class="comment">% --------------------------------------------------------------------</span>
2197 <a name="_sub78" href="#_subfunctions" class="code">function SecondaryFlowVectorVariable_Callback(hObject, eventdata, handles)</a>
2198 
2199 <span class="comment">% Get the Application data:</span>
2200 <span class="comment">% -------------------------</span>
2201 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2202 
2203 <span class="comment">% Modify the Application data:</span>
2204 <span class="comment">% ----------------------------</span>
2205 idx_variable = get(hObject,<span class="string">'Value'</span>);
2206 guiparams.idx_secondary_flow_vector_variable = idx_variable;
2207 guiparams.secondary_flow_vector_variable = guiparams.secondary_flows(idx_variable).variable;
2208 
2209 <span class="comment">% Re-store the Application data:</span>
2210 <span class="comment">% ------------------------------</span>
2211 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2212 
2213 <span class="comment">% [EOF] SecondaryFlowVectorVariable_Callback</span>
2214 
2215 
2216 <span class="comment">% --------------------------------------------------------------------</span>
2217 <a name="_sub79" href="#_subfunctions" class="code">function IncludeVerticalVelocity_Callback(hObject, eventdata, handles)</a>
2218 
2219 <span class="comment">% Get the Application data:</span>
2220 <span class="comment">% -------------------------</span>
2221 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2222 
2223 <span class="comment">% Modify the Application data:</span>
2224 <span class="comment">% ----------------------------</span>
2225 guiparams.include_vertical_velocity = logical(get(hObject,<span class="string">'Value'</span>)); <span class="comment">% boolean</span>
2226 
2227 <span class="comment">% Re-store the Application data:</span>
2228 <span class="comment">% ------------------------------</span>
2229 setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2230 
2231 <span class="comment">% [EOF] IncludeVerticalVelocity_Callback</span>
2232 
2233 
2234 <span class="comment">% --------------------------------------------------------------------</span>
2235 <a name="_sub80" href="#_subfunctions" class="code">function PlotCrossSection_Callback(hObject, eventdata, handles)</a>
2236 <a href="#_sub49" class="code" title="subfunction crosssectionPlotCallback(hObject, eventdata, handles)">crosssectionPlotCallback</a>(hObject, eventdata, handles)
2237 <span class="comment">% [EOF] PlotCrossSection_Callback</span>
2238 
2239 
2240 <span class="comment">% --------------------------------------------------------------------</span>
2241 <a name="_sub81" href="#_subfunctions" class="code">function ClearLog_Callback(hObject, eventdata, handles)</a>
2242 set(handles.LogWindow,<span class="string">'string'</span>,<span class="string">''</span>)
2243 <span class="comment">% [EOF] ClearLog_Callback</span>
2244 
2245 <span class="comment">% --------------------------------------------------------------------</span>
2246 <a name="_sub82" href="#_subfunctions" class="code">function SaveLog_Callback(hObject, eventdata, handles)</a>
2247 
2248 <span class="comment">% Get the Application data:</span>
2249 <span class="comment">% -------------------------</span>
2250 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2251 guiprefs  = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
2252 <span class="comment">% z   = guiparams.z;   %#ok&lt;NASGU&gt;</span>
2253 <span class="comment">% A   = guiparams.A;   %#ok&lt;NASGU&gt;</span>
2254 <span class="comment">% V   = guiparams.V;   %#ok&lt;NASGU&gt;</span>
2255 <span class="comment">% Map = guiparams.Map; %#ok&lt;NASGU&gt;</span>
2256 
2257 [the_file,the_path] = <span class="keyword">...</span>
2258     uiputfile({<span class="string">'*.txt'</span>,<span class="string">'TXT-Files (*.txt)'</span>}, <span class="keyword">...</span>
2259     <span class="string">'Choose where to save the log file'</span>, <span class="keyword">...</span>
2260     fullfile(guiprefs.log_path,guiprefs.log_file));
2261 
2262 <span class="comment">% Save the log to a TXT file:</span>
2263 <span class="comment">% ---------------------------</span>
2264 <span class="keyword">if</span> ischar(the_file)
2265     guiparams.log_path = the_path;
2266     guiparams.log_file = the_file;
2267     <span class="comment">%guiparams.savefile = the_file;</span>
2268     
2269     <span class="comment">% Re-store the Application data:</span>
2270     <span class="comment">% ------------------------------</span>
2271     setappdata(handles.figure1,<span class="string">'guiparams'</span>,guiparams)
2272     
2273     <span class="comment">% Update the preferences:</span>
2274     <span class="comment">% -----------------------</span>
2275     guiprefs = getappdata(handles.figure1,<span class="string">'guiprefs'</span>);
2276     guiprefs.log_path = the_path;
2277     guiprefs.log_file = the_file;
2278     setappdata(handles.figure1,<span class="string">'guiprefs'</span>,guiprefs)
2279     <a href="#_sub85" class="code" title="subfunction store_prefs(hfigure,pref)">store_prefs</a>(handles.figure1,<span class="string">'log'</span>)
2280     
2281     [~,filename,extension] = fileparts(the_file);
2282     savefile = [the_path filename extension];
2283     h = msgbox([<span class="string">'Saving log to: '''</span> savefile <span class="string">''''</span>], <span class="keyword">...</span>
2284         <span class="string">'Saving Log File...'</span>); <span class="comment">%#ok&lt;NASGU&gt;</span>
2285     
2286     logfile = get(handles.LogWindow,<span class="string">'string'</span>);
2287     [nrows,~]= size(logfile);
2288     fid = fopen(savefile, <span class="string">'w'</span>);
2289     <span class="keyword">for</span> row=1:nrows
2290         fprintf(fid, <span class="string">'%s \n'</span>, logfile{row,:});
2291     <span class="keyword">end</span>
2292     fclose(fid);
2293 <span class="keyword">end</span>
2294 <span class="comment">% [EOF] SaveLog_Callback</span>
2295 
2296 <span class="comment">%%%%%%%%%%%%%%%%</span>
2297 <span class="comment">% SUBFUNCTIONS %</span>
2298 <span class="comment">%%%%%%%%%%%%%%%%</span>
2299 
2300 <span class="comment">% --------------------------------------------------------------------</span>
2301 <a name="_sub83" href="#_subfunctions" class="code">function handles = buildToolbar(handles)</a>
2302 
2303 icons = <a href="#_sub99" class="code" title="subfunction icons = getIcons">getIcons</a>;
2304 ht = uitoolbar(<span class="string">'Parent'</span>,handles.figure1);
2305 
2306 <span class="comment">% Load data</span>
2307 <span class="comment">% icon = imread('C:\Users\pfricker\Desktop\icons\file_open.png');</span>
2308 <span class="comment">% icon = double(icon)/(2^16-1);</span>
2309 <span class="comment">% icon(icon==0) = NaN;</span>
2310 handles.toolbarLoadData = <span class="keyword">...</span>
2311     uipushtool(<span class="string">'Parent'</span>,       ht, <span class="keyword">...</span>
2312     <span class="string">'CData'</span>,        icons(1).data, <span class="keyword">...</span>
2313     <span class="string">'TooltipString'</span>,<span class="string">'Open ASCII File'</span>);
2314 
2315 <span class="comment">% Save data</span>
2316 <span class="comment">% icon = imread('C:\Users\pfricker\Desktop\icons\file_save.png');</span>
2317 <span class="comment">% icon = double(icon)/(2^16-1);</span>
2318 <span class="comment">% icon(icon==0) = NaN;</span>
2319 handles.toolbarSaveMatFile = <span class="keyword">...</span>
2320     uipushtool(<span class="string">'Parent'</span>,       ht, <span class="keyword">...</span>
2321     <span class="string">'CData'</span>,        icons(2).data, <span class="keyword">...</span>
2322     <span class="string">'TooltipString'</span>,<span class="string">'Save MAT File'</span>, <span class="keyword">...</span>
2323     <span class="string">'Separator'</span>,    <span class="string">'on'</span>);
2324 
2325 
2326 <span class="comment">% Save bathymetry</span>
2327 <span class="comment">%icon = ones(16,16,3);</span>
2328 handles.toolbarSaveBathymetry = <span class="keyword">...</span>
2329     uipushtool(<span class="string">'Parent'</span>,       ht, <span class="keyword">...</span>
2330     <span class="string">'CData'</span>,        icons(5).data, <span class="keyword">...</span>
2331     <span class="string">'TooltipString'</span>,<span class="string">'Export Bathymetry'</span>);
2332 
2333 <span class="comment">% Save figures</span>
2334 <span class="comment">% icon = ones(16,16,3);</span>
2335 handles.toolbarSaveFigures = <span class="keyword">...</span>
2336     uipushtool(<span class="string">'Parent'</span>,       ht, <span class="keyword">...</span>
2337     <span class="string">'CData'</span>,        icons(6).data, <span class="keyword">...</span>
2338     <span class="string">'TooltipString'</span>,<span class="string">'Export Figures'</span>);
2339 
2340 
2341 <span class="comment">% Plotting parameters</span>
2342 <span class="comment">% [icon,map] = imread('C:\Users\pfricker\Desktop\icons\PlotGeneralElement.gif');</span>
2343 <span class="comment">% icon = ind2rgb(icon,map);</span>
2344 handles.toolbarPlottingParameters = <span class="keyword">...</span>
2345     uipushtool(<span class="string">'Parent'</span>,       ht, <span class="keyword">...</span>
2346     <span class="string">'CData'</span>,        icons(3).data, <span class="keyword">...</span>
2347     <span class="string">'TooltipString'</span>,<span class="string">'Plotting Parameters'</span>, <span class="keyword">...</span>
2348     <span class="string">'Separator'</span>,    <span class="string">'on'</span>);
2349 
2350 <span class="comment">% Processing parameters</span>
2351 <span class="comment">% [icon,map] = imread('C:\Users\pfricker\Desktop\icons\ParameterIcon.gif');</span>
2352 <span class="comment">% icon = ind2rgb(icon,map);</span>
2353 handles.toolbarProcessingParameters = <span class="keyword">...</span>
2354     uipushtool(<span class="string">'Parent'</span>,       ht, <span class="keyword">...</span>
2355     <span class="string">'CData'</span>,        icons(4).data, <span class="keyword">...</span>
2356     <span class="string">'TooltipString'</span>,<span class="string">'Processing Parameters'</span>);
2357 
2358 <span class="comment">% % Plot 1: Shiptracks</span>
2359 <span class="comment">% handles.shiptracksPlot = ...</span>
2360 <span class="comment">%     uipushtool('Parent',       ht, ...</span>
2361 <span class="comment">%                'CData',        icon, ...</span>
2362 <span class="comment">%                'TooltipString','Shiptracks plot', ...</span>
2363 <span class="comment">%                'Separator',    'on');</span>
2364 <span class="comment">%</span>
2365 <span class="comment">% % Plot 2: Plan view</span>
2366 <span class="comment">% handles.planviewPlot = ...</span>
2367 <span class="comment">%     uipushtool('Parent',       ht, ...</span>
2368 <span class="comment">%                'CData',        icon, ...</span>
2369 <span class="comment">%                'TooltipString','Plan view plot');</span>
2370 <span class="comment">%</span>
2371 <span class="comment">% % Plot 3: Cross section</span>
2372 <span class="comment">% handles.crosssectionPlot = ...</span>
2373 <span class="comment">%     uipushtool('Parent',       ht, ...</span>
2374 <span class="comment">%                'CData',        icon, ...</span>
2375 <span class="comment">%                'TooltipString','Cross section plot');</span>
2376 
2377 set(handles.toolbarLoadData,            <span class="string">'ClickedCallback'</span>,{@<a href="#_sub42" class="code" title="subfunction loadDataCallback(hObject, eventdata, handles)">loadDataCallback</a>,handles})
2378 set(handles.toolbarSaveMatFile,         <span class="string">'ClickedCallback'</span>,{@<a href="#_sub43" class="code" title="subfunction saveDataCallback(hObject, eventdata, handles)">saveDataCallback</a>,handles})
2379 set(handles.toolbarSaveBathymetry,      <span class="string">'ClickedCallback'</span>,{@<a href="#_sub53" class="code" title="subfunction ExportMultibeamBathymetry_Callback(hObject, eventdata, handles)">ExportMultibeamBathymetry_Callback</a>,handles})
2380 set(handles.toolbarSaveFigures,         <span class="string">'ClickedCallback'</span>,{@<a href="#_sub17" class="code" title="subfunction menuExportFigures_Callback(hObject, eventdata, handles)">menuExportFigures_Callback</a>,handles})
2381 set(handles.toolbarPlottingParameters,  <span class="string">'ClickedCallback'</span>,{@<a href="#_sub45" class="code" title="subfunction plottingParametersCallback(hObject, eventdata, handles)">plottingParametersCallback</a>,handles})
2382 set(handles.toolbarProcessingParameters,<span class="string">'ClickedCallback'</span>,{@<a href="#_sub46" class="code" title="subfunction processingParametersCallback(hObject, eventdata, handles)">processingParametersCallback</a>,handles})
2383 <span class="comment">% set(handles.shiptracksPlot,      'ClickedCallback',{@shiptracksPlotCallback,handles})</span>
2384 <span class="comment">% set(handles.planviewPlot,        'ClickedCallback',{@planviewPlotCallback,handles})</span>
2385 <span class="comment">% set(handles.crosssectionPlot,    'ClickedCallback',{@crosssectionPlotCallback,handles})</span>
2386 
2387 <span class="comment">% [EOF] buildtoolbar</span>
2388 
2389 
2390 <span class="comment">% --------------------------------------------------------------------</span>
2391 <a name="_sub84" href="#_subfunctions" class="code">function load_prefs(hfigure)</a>
2392 <span class="comment">% Load the GUI preferences.  Also, initialize preferences if they don't</span>
2393 <span class="comment">% already exist.</span>
2394 
2395 <span class="comment">% Preferences:</span>
2396 <span class="comment">% 'ascii'               Path and filenames of current ASCII files</span>
2397 <span class="comment">% 'mat'                 Path and filename of current MAT file</span>
2398 <span class="comment">% 'tecplot'             Path and filename of last Tecplot file</span>
2399 <span class="comment">% 'kmz'                 Path and filename of last KMZ file</span>
2400 <span class="comment">% 'multibeambathymetry' Path and filename of last Multibeam Bathymetry file</span>
2401 <span class="comment">% 'log'                 Path and filename of last Log file</span>
2402 
2403 <span class="comment">% Originals</span>
2404 <span class="comment">% prefs = {'ascii2gispath' 'ascii2kmlpath' 'asciipath'   'doqqpath' ...</span>
2405 <span class="comment">%          'endspath'      'logpath'       'matpath'     'savedpath' ...</span>
2406 <span class="comment">%          'shorepath'     'stapath'       'ysidatapath' 'ysidatapath'};</span>
2407 
2408 <span class="comment">% ASCII</span>
2409 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'ascii'</span>)
2410     ascii = getpref(<span class="string">'VMT'</span>,<span class="string">'ascii'</span>);
2411     <span class="keyword">if</span> exist(ascii.path,<span class="string">'dir'</span>)
2412         guiprefs.ascii_path = ascii.path;
2413     <span class="keyword">else</span>
2414         guiprefs.ascii_path = pwd;
2415     <span class="keyword">end</span>
2416     does_exist = false(1,length(ascii.file));
2417     <span class="keyword">for</span> k = 1:length(ascii.file) <span class="comment">% Check each file one-by-one</span>
2418         does_exist(k) = exist(fullfile(ascii.path,ascii.file{k}),<span class="string">'file'</span>);
2419     <span class="keyword">end</span>
2420     <span class="keyword">if</span> any(does_exist)
2421         guiprefs.ascii_file = ascii.file(does_exist);
2422     <span class="keyword">else</span>
2423         guiprefs.ascii_file = {<span class="string">''</span>};
2424     <span class="keyword">end</span>
2425 <span class="keyword">else</span> <span class="comment">% Initialize ASCII</span>
2426     guiprefs.ascii_path = pwd;
2427     guiprefs.ascii_file = {<span class="string">''</span>};
2428     
2429     ascii.path = pwd;
2430     ascii.file = {<span class="string">''</span>};
2431     setpref(<span class="string">'VMT'</span>,<span class="string">'ascii'</span>,ascii)
2432 <span class="keyword">end</span>
2433 
2434 <span class="comment">% MAT</span>
2435 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'mat'</span>)
2436     mat = getpref(<span class="string">'VMT'</span>,<span class="string">'mat'</span>);
2437     <span class="keyword">if</span> exist(mat.path,<span class="string">'dir'</span>)
2438         guiprefs.mat_path = mat.path;
2439     <span class="keyword">else</span>
2440         guiprefs.mat_path = pwd;
2441     <span class="keyword">end</span>
2442     
2443     <span class="keyword">if</span> iscell(mat.file)
2444         <span class="keyword">if</span> exist(fullfile(mat.path,mat.file{1}),<span class="string">'file'</span>)
2445             guiprefs.mat_file = mat.file;
2446         <span class="keyword">else</span>
2447             guiprefs.mat_file = <span class="string">''</span>;
2448         <span class="keyword">end</span>
2449     <span class="keyword">else</span>
2450         <span class="keyword">if</span> exist(fullfile(mat.path,mat.file),<span class="string">'file'</span>)
2451             guiprefs.mat_file = mat.file;
2452         <span class="keyword">else</span>
2453             guiprefs.mat_file = <span class="string">''</span>;
2454         <span class="keyword">end</span>
2455     <span class="keyword">end</span>
2456 <span class="keyword">else</span> <span class="comment">% Initialize MAT</span>
2457     guiprefs.mat_path = pwd;
2458     guiprefs.mat_file = <span class="string">''</span>;
2459     
2460     mat.path = pwd;
2461     mat.file = <span class="string">''</span>;
2462     setpref(<span class="string">'VMT'</span>,<span class="string">'mat'</span>,mat)
2463 <span class="keyword">end</span>
2464 
2465 <span class="comment">% TECPLOT</span>
2466 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'tecplot'</span>)
2467     tecplot = getpref(<span class="string">'VMT'</span>,<span class="string">'tecplot'</span>);
2468     <span class="keyword">if</span> exist(tecplot.path,<span class="string">'dir'</span>)
2469         guiprefs.tecplot_path = tecplot.path;
2470     <span class="keyword">else</span>
2471         guiprefs.tecplot_path = pwd;
2472     <span class="keyword">end</span>
2473     <span class="keyword">if</span> exist(fullfile(tecplot.path,tecplot.file),<span class="string">'file'</span>)
2474         guiprefs.tecplot_file = tecplot.file;
2475     <span class="keyword">else</span>
2476         guiprefs.tecplot_file = <span class="string">''</span>;
2477     <span class="keyword">end</span>
2478 <span class="keyword">else</span> <span class="comment">% Initialize TECPLOT</span>
2479     guiprefs.tecplot_path = pwd;
2480     guiprefs.tecplot_file = <span class="string">''</span>;
2481     
2482     tecplot.path = pwd;
2483     tecplot.file = <span class="string">''</span>;
2484     setpref(<span class="string">'VMT'</span>,<span class="string">'tecplot'</span>,tecplot)
2485 <span class="keyword">end</span>
2486 
2487 <span class="comment">% KMZ</span>
2488 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'kmz'</span>)
2489     kmz = getpref(<span class="string">'VMT'</span>,<span class="string">'kmz'</span>);
2490     <span class="keyword">if</span> exist(kmz.path,<span class="string">'dir'</span>)
2491         guiprefs.kmz_path = kmz.path;
2492     <span class="keyword">else</span>
2493         guiprefs.kmz_path = pwd;
2494     <span class="keyword">end</span>
2495     <span class="keyword">if</span> exist(fullfile(kmz.path,kmz.file),<span class="string">'file'</span>)
2496         guiprefs.kmz_file = kmz.file;
2497     <span class="keyword">else</span>
2498         guiprefs.kmz_file = <span class="string">''</span>;
2499     <span class="keyword">end</span>
2500 <span class="keyword">else</span> <span class="comment">% Initialize KMZ</span>
2501     guiprefs.kmz_path = pwd;
2502     guiprefs.kmz_file = <span class="string">''</span>;
2503     
2504     kmz.path = pwd;
2505     kmz.file = <span class="string">''</span>;
2506     setpref(<span class="string">'VMT'</span>,<span class="string">'kmz'</span>,kmz)
2507 <span class="keyword">end</span>
2508 
2509 <span class="comment">% MULTIBEAM BATHYMETRY</span>
2510 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'multibeambathymetry'</span>)
2511     multibeambathymetry = getpref(<span class="string">'VMT'</span>,<span class="string">'multibeambathymetry'</span>);
2512     <span class="keyword">if</span> exist(multibeambathymetry.path,<span class="string">'dir'</span>)
2513         guiprefs.multibeambathymetry_path = multibeambathymetry.path;
2514     <span class="keyword">else</span>
2515         guiprefs.multibeambathymetry_path = pwd;
2516     <span class="keyword">end</span>
2517     <span class="keyword">if</span> exist(fullfile(multibeambathymetry.path,multibeambathymetry.file),<span class="string">'file'</span>)
2518         guiprefs.multibeambathymetry_file = multibeambathymetry.file;
2519     <span class="keyword">else</span>
2520         guiprefs.multibeambathymetry_file = <span class="string">''</span>;
2521     <span class="keyword">end</span>
2522 <span class="keyword">else</span> <span class="comment">% Initialize MULTIBEAM BATHYMETRY</span>
2523     guiprefs.multibeambathymetry_path = pwd;
2524     guiprefs.multibeambathymetry_file = <span class="string">''</span>;
2525     
2526     multibeambathymetry.path = pwd;
2527     multibeambathymetry.file = <span class="string">''</span>;
2528     setpref(<span class="string">'VMT'</span>,<span class="string">'multibeambathymetry'</span>,multibeambathymetry)
2529 <span class="keyword">end</span>
2530 
2531 <span class="comment">% Log</span>
2532 <span class="keyword">if</span> ispref(<span class="string">'VMT'</span>,<span class="string">'log'</span>)
2533     log = getpref(<span class="string">'VMT'</span>,<span class="string">'log'</span>);
2534     <span class="keyword">if</span> exist(log.path,<span class="string">'dir'</span>)
2535         guiprefs.log_path = log.path;
2536     <span class="keyword">else</span>
2537         guiprefs.log_path = pwd;
2538     <span class="keyword">end</span>
2539     <span class="keyword">if</span> exist(fullfile(log.path,log.file),<span class="string">'file'</span>)
2540         guiprefs.log_file = log.file;
2541     <span class="keyword">else</span>
2542         guiprefs.log_file = <span class="string">''</span>;
2543     <span class="keyword">end</span>
2544 <span class="keyword">else</span> <span class="comment">% Initialize Log</span>
2545     guiprefs.log_path = pwd;
2546     guiprefs.log_file = <span class="string">''</span>;
2547     
2548     log.path = pwd;
2549     log.file = <span class="string">''</span>;
2550     setpref(<span class="string">'VMT'</span>,<span class="string">'log'</span>,log)
2551 <span class="keyword">end</span>
2552 
2553 <span class="comment">% guiprefs.presentation = true;</span>
2554 <span class="comment">% guiprefs.print        = false;</span>
2555 
2556 <span class="comment">% for k = 1:length(prefs)</span>
2557 <span class="comment">%     newpref = '';</span>
2558 <span class="comment">%     if ispref('VMT',prefs{k})</span>
2559 <span class="comment">%         stored_newpref = getpref('VMT',prefs{k});</span>
2560 <span class="comment">%         if exist(stored_newpref,'dir')</span>
2561 <span class="comment">%             newpref = stored_newpref;</span>
2562 <span class="comment">%         else</span>
2563 <span class="comment">%             setpref('VMT',prefs{k},newpref)</span>
2564 <span class="comment">%         end</span>
2565 <span class="comment">%     end</span>
2566 <span class="comment">%     guiprefs.(prefs{k}) = newpref;</span>
2567 <span class="comment">% end</span>
2568 
2569 setappdata(hfigure,<span class="string">'guiprefs'</span>,guiprefs)
2570 
2571 <span class="comment">% [EOF] load_prefs</span>
2572 
2573 
2574 <span class="comment">% --------------------------------------------------------------------</span>
2575 <a name="_sub85" href="#_subfunctions" class="code">function store_prefs(hfigure,pref)</a>
2576 <span class="comment">% Store preferences in the Application data and in the persistent</span>
2577 <span class="comment">% preferences data.</span>
2578 
2579 <span class="comment">% Preferences:</span>
2580 <span class="comment">% 'ascii'               Path and filenames of current ASCII files</span>
2581 <span class="comment">% 'mat'                 Path and filename of current MAT file</span>
2582 <span class="comment">% 'tecplot'             Path and filename of last Tecplot file</span>
2583 <span class="comment">% 'kmz'                 Path and filename of last KMZ file</span>
2584 <span class="comment">% 'multibeambathymetry' Path and filename of last Multibeam Bathymetry file</span>
2585 <span class="comment">% 'log'                 Path and filename of last Log file</span>
2586 
2587 guiprefs = getappdata(hfigure,<span class="string">'guiprefs'</span>);
2588 
2589 <span class="keyword">switch</span> pref
2590     <span class="keyword">case</span> <span class="string">'ascii'</span>
2591         ascii.path = guiprefs.ascii_path;
2592         ascii.file = guiprefs.ascii_file;
2593         setpref(<span class="string">'VMT'</span>,<span class="string">'ascii'</span>,ascii)
2594     <span class="keyword">case</span> <span class="string">'mat'</span>
2595         mat.path = guiprefs.mat_path;
2596         mat.file = guiprefs.mat_file;
2597         setpref(<span class="string">'VMT'</span>,<span class="string">'mat'</span>,mat)
2598     <span class="keyword">case</span> <span class="string">'tecplot'</span>
2599         tecplot.path = guiprefs.tecplot_path;
2600         tecplot.file = guiprefs.tecplot_file;
2601         setpref(<span class="string">'VMT'</span>,<span class="string">'tecplot'</span>,tecplot)
2602     <span class="keyword">case</span> <span class="string">'kmz'</span>
2603         kmz.path = guiprefs.kmz_path;
2604         kmz.file = guiprefs.kmz_file;
2605         setpref(<span class="string">'VMT'</span>,<span class="string">'kmz'</span>,kmz)
2606     <span class="keyword">case</span> <span class="string">'multibeambathymetry'</span>
2607         multibeambathymetry.path = guiprefs.multibeambathymetry_path;
2608         multibeambathymetry.file = guiprefs.multibeambathymetry_file;
2609         setpref(<span class="string">'VMT'</span>,<span class="string">'multibeambathymetry'</span>,multibeambathymetry)
2610     <span class="keyword">case</span> <span class="string">'log'</span>
2611         log.path = guiprefs.log_path;
2612         log.file = guiprefs.log_file;
2613         setpref(<span class="string">'VMT'</span>,<span class="string">'log'</span>,log)
2614     <span class="keyword">otherwise</span>
2615 <span class="keyword">end</span>
2616 
2617 <span class="comment">% if ismember(pref,prefs)</span>
2618 <span class="comment">%     setpref('VMT',pref,value)</span>
2619 <span class="comment">%</span>
2620 <span class="comment">%     guiprefs = getappdata(hfigure,'guiprefs');</span>
2621 <span class="comment">%     guiprefs.(pref) = value;</span>
2622 <span class="comment">%     setappdata(hfigure,'guiprefs',guiprefs)</span>
2623 <span class="comment">% end</span>
2624 
2625 <span class="comment">% [EOF] store_prefs</span>
2626 
2627 
2628 <span class="comment">% --------------------------------------------------------------------</span>
2629 <a name="_sub86" href="#_subfunctions" class="code">function initGUI(handles)</a>
2630 <span class="comment">% Initialize the UI controls in the GUI.</span>
2631 
2632 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2633 
2634 <span class="comment">% Set the name and version</span>
2635 set(handles.figure1,<span class="string">'Name'</span>,[<span class="string">'Velocity Mapping Toolbox (VMT) '</span> guiparams.vmt_version], <span class="keyword">...</span>
2636     <span class="string">'DockControls'</span>,<span class="string">'off'</span>)
2637 <span class="comment">%set(handles.VMTversion,             'String',guiparams.vmt_version)</span>
2638 
2639 <span class="comment">% Set the PLOT 1 axis labels</span>
2640 axes(handles.Plot1Shiptracks);
2641 set(handles.Plot1Shiptracks,<span class="string">'DataAspectRatio'</span>,[1 1 1],<span class="string">'PlotBoxAspectRatio'</span>,[1 1 1])
2642 xlabel(<span class="string">'UTM Easting (m)'</span>)
2643 ylabel(<span class="string">'UTM Northing (m)'</span>)
2644 box on
2645 grid on
2646 <span class="comment">% ticks_format('%6.0f','%8.0f'); %formats the ticks for UTM</span>
2647 
2648 <span class="comment">%%%%%%%%%%%%</span>
2649 <span class="comment">% MENU BAR %</span>
2650 <span class="comment">%%%%%%%%%%%%</span>
2651 <span class="keyword">if</span> guiparams.english_units
2652     set(handles.menuMetric, <span class="string">'Checked'</span>,<span class="string">'off'</span>)
2653     set(handles.menuEnglish,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
2654 <span class="keyword">else</span>
2655     set(handles.menuMetric, <span class="string">'Checked'</span>,<span class="string">'on'</span>)
2656     set(handles.menuEnglish,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
2657 <span class="keyword">end</span>
2658 
2659 <span class="keyword">if</span> guiparams.set_cross_section_endpoints
2660     set(handles.menuCrossSectionEndpointAutomatic,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
2661     set(handles.menuCrossSectionEndpointManual,   <span class="string">'Checked'</span>,<span class="string">'on'</span>)
2662 <span class="keyword">else</span>
2663     set(handles.menuCrossSectionEndpointAutomatic,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
2664     set(handles.menuCrossSectionEndpointManual,   <span class="string">'Checked'</span>,<span class="string">'off'</span>)
2665 <span class="keyword">end</span>
2666 
2667 
2668 <span class="keyword">if</span> guiparams.print
2669     set(handles.menuPrintFormat,       <span class="string">'Checked'</span>,<span class="string">'on'</span>)
2670     set(handles.menuPresentationFormat,<span class="string">'Checked'</span>,<span class="string">'off'</span>)
2671     set(handles.menuStylePrint,        <span class="string">'Checked'</span>,<span class="string">'on'</span>)
2672     set(handles.menuStylePresentation, <span class="string">'Checked'</span>,<span class="string">'off'</span>)
2673 <span class="keyword">elseif</span> guiparams.presentation
2674     set(handles.menuPrintFormat,       <span class="string">'Checked'</span>,<span class="string">'off'</span>)
2675     set(handles.menuPresentationFormat,<span class="string">'Checked'</span>,<span class="string">'on'</span>)
2676     set(handles.menuStylePrint,        <span class="string">'Checked'</span>,<span class="string">'off'</span>)
2677     set(handles.menuStylePresentation, <span class="string">'Checked'</span>,<span class="string">'on'</span>)
2678 <span class="keyword">else</span>
2679 <span class="keyword">end</span>
2680 
2681 
2682 <span class="comment">%%%%%%%%%%%%%%%</span>
2683 <span class="comment">% DATA EXPORT %</span>
2684 <span class="comment">%%%%%%%%%%%%%%%</span>
2685 <span class="comment">% BathymetryPanel</span>
2686 <span class="comment">% set(handles.BeamAngle,                  'String',guiparams.beam_angle)</span>
2687 <span class="comment">% set(handles.MagneticVariation,          'String',guiparams.magnetic_variation)</span>
2688 <span class="comment">% set(handles.WSE,                        'String',guiparams.wse)</span>
2689 <span class="comment">% set(handles.OutputAuxiliaryData,        'Value', guiparams.output_auxiliary_data)</span>
2690 
2691 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%</span>
2692 <span class="comment">% PLOTTING/PLAN VIEW %</span>
2693 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%</span>
2694 <span class="comment">% PlanViewPanel</span>
2695 set(handles.DepthRangeMin,              <span class="string">'String'</span>,guiparams.depth_range_min)
2696 set(handles.DepthRangeMax,              <span class="string">'String'</span>,guiparams.depth_range_max)
2697 set(handles.VectorScalePlanView,        <span class="string">'String'</span>,guiparams.vector_scale_plan_view)
2698 set(handles.VectorSpacingPlanview,      <span class="string">'String'</span>,guiparams.vector_spacing_plan_view)
2699 set(handles.SmoothingWindowSize,        <span class="string">'String'</span>,guiparams.smoothing_window_size)
2700 set(handles.MapDepthAveragedVelocities, <span class="string">'Value'</span>, guiparams.map_depth_averaged_velocities)
2701 set(handles.DisplayShoreline,           <span class="string">'Value'</span>, guiparams.display_shoreline)
2702 set(handles.AddBackground,              <span class="string">'Value'</span>, guiparams.add_background)
2703 
2704 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%</span>
2705 <span class="comment">% PLOTTING/SHIP TRACKS %</span>
2706 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%</span>
2707 <span class="comment">% ShiptracksPanel</span>
2708 set(handles.HorizontalGridNodeSpacing,  <span class="string">'String'</span>,guiparams.horizontal_grid_node_spacing)
2709 <span class="comment">%set(handles.SetCrossSectionEndpoints,   'Value', guiparams.set_cross_section_endpoints)</span>
2710 
2711 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
2712 <span class="comment">% PLOTTING/CROSS SECTIONS %</span>
2713 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
2714 <span class="comment">% CrossSectionsPanel</span>
2715 set(handles.Contour,                    <span class="string">'String'</span>,{guiparams.contours.string}, <span class="keyword">...</span>
2716     <span class="string">'Value'</span>, guiparams.idx_contour)
2717 set(handles.VerticalExaggeration,       <span class="string">'String'</span>,guiparams.vertical_exaggeration)
2718 set(handles.VectorScaleCrossSection,    <span class="string">'String'</span>,guiparams.vector_scale_cross_section)
2719 set(handles.HorizontalVectorSpacing,    <span class="string">'String'</span>,guiparams.horizontal_vector_spacing)
2720 set(handles.VerticalVectorSpacing,      <span class="string">'String'</span>,guiparams.vertical_vector_spacing)
2721 set(handles.HorizontalSmoothingWindow,  <span class="string">'String'</span>,guiparams.horizontal_smoothing_window)
2722 set(handles.VerticalSmoothingWindow,    <span class="string">'String'</span>,guiparams.vertical_smoothing_window)
2723 set(handles.PlotSecondaryFlowVectors,   <span class="string">'Value'</span>, guiparams.plot_secondary_flow_vectors)
2724 set(handles.SecondaryFlowVectorVariable,<span class="string">'String'</span>,{guiparams.secondary_flows.string}, <span class="keyword">...</span>
2725     <span class="string">'Value'</span>, guiparams.idx_secondary_flow_vector_variable)
2726 set(handles.IncludeVerticalVelocity,    <span class="string">'Value'</span>, guiparams.include_vertical_velocity)
2727 
2728 <span class="comment">% set(handles.EnglishUnits,               'Value',guiparams.english_units)</span>
2729 
2730 <span class="comment">% [EOF] initGUI</span>
2731 
2732 
2733 <span class="comment">% --------------------------------------------------------------------</span>
2734 <a name="_sub87" href="#_subfunctions" class="code">function set_enable(handles,enable_state)</a>
2735 
2736 guiparams = getappdata(handles.figure1,<span class="string">'guiparams'</span>);
2737 
2738 <span class="keyword">switch</span> enable_state
2739     <span class="keyword">case</span> <span class="string">'init'</span>
2740         set([handles.menuFile
2741             handles.menuOpen
2742             handles.menuOpenASCII
2743             handles.menuOpenMAT
2744             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2745         set([handles.menuSave
2746             handles.menuParameters
2747             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2748         
2749         set([handles.toolbarLoadData
2750             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2751         set([handles.toolbarSaveMatFile
2752             handles.toolbarSaveBathymetry
2753             handles.toolbarSaveFigures
2754             handles.toolbarPlottingParameters
2755             handles.toolbarProcessingParameters
2756             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2757         
2758         <span class="comment">%         set([handles.SaveMATFile</span>
2759         <span class="comment">%              handles.SaveTecplotFile</span>
2760         <span class="comment">%              handles.SaveGoogleEarthFile</span>
2761         <span class="comment">%              ],'Enable','off')</span>
2762         
2763         <span class="comment">%         set([handles.ExportMultibeamBathymetry</span>
2764         <span class="comment">%              handles.BeamAngle</span>
2765         <span class="comment">%              handles.MagneticVariation</span>
2766         <span class="comment">%              handles.WSE</span>
2767         <span class="comment">%              handles.OutputAuxiliaryData</span>
2768         <span class="comment">%              ],'Enable','off')</span>
2769         
2770         set([handles.DepthRangeMin
2771             handles.DepthRangeMax
2772             handles.VectorScalePlanView
2773             handles.VectorSpacingPlanview
2774             handles.SmoothingWindowSize
2775             handles.MapDepthAveragedVelocities
2776             handles.DisplayShoreline
2777             handles.AddBackground
2778             handles.PlotPlanView
2779             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2780         
2781         set([handles.HorizontalGridNodeSpacing
2782             <span class="keyword">...</span><span class="comment">handles.SetCrossSectionEndpoints</span>
2783             handles.PlotShiptracks
2784             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2785         
2786         set([handles.Contour
2787             handles.VerticalExaggeration
2788             handles.VectorScaleCrossSection
2789             handles.HorizontalVectorSpacing
2790             handles.VerticalVectorSpacing
2791             handles.HorizontalSmoothingWindow
2792             handles.VerticalSmoothingWindow
2793             handles.PlotSecondaryFlowVectors
2794             handles.SecondaryFlowVectorVariable
2795             handles.IncludeVerticalVelocity
2796             handles.PlotCrossSection
2797             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2798         
2799     <span class="keyword">case</span> <span class="string">'fileloaded'</span>
2800         set([handles.menuFile
2801             handles.menuOpen
2802             handles.menuOpenASCII
2803             handles.menuOpenMAT
2804             handles.menuSave
2805             handles.menuSaveMAT
2806             handles.menuSaveTecplot
2807             handles.menuSaveKMZFile
2808             handles.menuParameters
2809             handles.menuPlottingParameters
2810             handles.menuMetric
2811             handles.menuEnglish
2812             handles.menuBathymetryExportSettings
2813             handles.menuExportMultibeamBathymetry
2814             handles.menuKMZExport
2815             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2816         
2817         set([handles.toolbarLoadData
2818             handles.toolbarSaveMatFile
2819             handles.toolbarSaveBathymetry
2820             handles.toolbarSaveFigures
2821             handles.toolbarPlottingParameters
2822             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2823         set([handles.toolbarProcessingParameters
2824             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2825         
2826            
2827         set([handles.DepthRangeMin
2828             handles.DepthRangeMax
2829             handles.VectorScalePlanView
2830             handles.VectorSpacingPlanview
2831             handles.SmoothingWindowSize
2832             handles.MapDepthAveragedVelocities
2833             handles.DisplayShoreline
2834             handles.PlotPlanView
2835             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2836         <span class="keyword">if</span> guiparams.has_mapping_toolbox
2837             set(handles.AddBackground,<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2838         <span class="keyword">else</span>
2839             set(handles.AddBackground,<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2840         <span class="keyword">end</span>
2841         
2842         set([handles.HorizontalGridNodeSpacing
2843             <span class="keyword">...</span><span class="comment">handles.SetCrossSectionEndpoints</span>
2844             handles.PlotShiptracks
2845             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2846         
2847         set([handles.Contour
2848             handles.VerticalExaggeration
2849             handles.VectorScaleCrossSection
2850             handles.HorizontalVectorSpacing
2851             handles.VerticalVectorSpacing
2852             handles.HorizontalSmoothingWindow
2853             handles.VerticalSmoothingWindow
2854             handles.PlotSecondaryFlowVectors
2855             handles.SecondaryFlowVectorVariable
2856             handles.IncludeVerticalVelocity
2857             handles.PlotCrossSection
2858             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2859     <span class="keyword">case</span> <span class="string">'multiplematfiles'</span>
2860         set([handles.menuFile
2861             handles.menuOpen
2862             handles.menuOpenASCII
2863             handles.menuOpenMAT
2864             handles.menuParameters
2865             handles.menuPlottingParameters
2866             handles.menuMetric
2867             handles.menuEnglish
2868             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2869         set([handles.menuSave
2870             handles.menuSaveMAT
2871             handles.menuBathymetryExportSettings
2872             handles.menuExportMultibeamBathymetry
2873             handles.menuKMZExport
2874             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2875         
2876         set([handles.toolbarLoadData
2877             handles.toolbarSaveFigures
2878             handles.toolbarPlottingParameters
2879             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2880         set([handles.toolbarProcessingParameters
2881             handles.toolbarSaveMatFile
2882             handles.toolbarSaveBathymetry
2883             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2884         
2885         set([handles.DepthRangeMin
2886             handles.DepthRangeMax
2887             handles.VectorScalePlanView
2888             handles.VectorSpacingPlanview
2889             handles.SmoothingWindowSize
2890             handles.MapDepthAveragedVelocities
2891             handles.DisplayShoreline
2892             handles.PlotPlanView
2893             ],<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2894         <span class="keyword">if</span> guiparams.has_mapping_toolbox
2895             set(handles.AddBackground,<span class="string">'Enable'</span>,<span class="string">'on'</span>)
2896         <span class="keyword">else</span>
2897             set(handles.AddBackground,<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2898         <span class="keyword">end</span>
2899         
2900         set([handles.HorizontalGridNodeSpacing
2901             <span class="keyword">...</span><span class="comment">handles.SetCrossSectionEndpoints</span>
2902             handles.PlotShiptracks
2903             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2904         
2905         set([handles.Contour
2906             handles.VerticalExaggeration
2907             handles.VectorScaleCrossSection
2908             handles.HorizontalVectorSpacing
2909             handles.VerticalVectorSpacing
2910             handles.HorizontalSmoothingWindow
2911             handles.VerticalSmoothingWindow
2912             handles.PlotSecondaryFlowVectors
2913             handles.SecondaryFlowVectorVariable
2914             handles.IncludeVerticalVelocity
2915             handles.PlotCrossSection
2916             ],<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2917     <span class="keyword">otherwise</span>
2918 <span class="keyword">end</span>
2919 
2920 <span class="comment">% Temporary</span>
2921 set(handles.MapDepthAveragedVelocities,<span class="string">'Value'</span>,0,<span class="string">'Enable'</span>,<span class="string">'off'</span>)
2922 
2923 <span class="comment">% [EOF] set_enable</span>
2924 
2925 <span class="comment">%% Compute the longitudinal dispersion coefficient</span>
2926 
2927 <span class="comment">%% --- Executes on button press in zerosecq_chkbox.</span>
2928 <span class="comment">%function zerosecq_chkbox_Callback(hObject, eventdata, handles)</span>
2929 <span class="comment">% hObject    handle to zerosecq_chkbox (see GCBO)</span>
2930 <span class="comment">% eventdata  reserved - to be defined in a future version of MATLAB</span>
2931 <span class="comment">% handles    structure with handles and user data (see GUIDATA)</span>
2932 
2933 <span class="comment">% Hint: get(hObject,'Value') returns toggle state of zerosecq_chkbox</span>
2934 
2935 
2936 <span class="comment">% --------------------------------------------------------------------</span>
2937 <a name="_sub88" href="#_subfunctions" class="code">function [english_units,set_cross_section_endpoints,plot_presentation_style,plot_print_style] = </a><span class="keyword">...</span>
2938     plotParametersDialog(english_units,set_cross_section_endpoints,plot_presentation_style,plot_print_style,hf)
2939 
2940 w = 500;
2941 h = 110;
2942 dx = 10;
2943 dy = 35;
2944 the_color = get(0,<span class="string">'factoryUipanelBackgroundColor'</span>);
2945 handles.Figure = figure(<span class="string">'Name'</span>, <span class="string">'Plotting Parameters'</span>, <span class="keyword">...</span>
2946     <span class="string">'Color'</span>,the_color, <span class="keyword">...</span>
2947     <span class="string">'NumberTitle'</span>,<span class="string">'off'</span>, <span class="keyword">...</span>
2948     <span class="string">'HandleVisibility'</span>,<span class="string">'callback'</span>, <span class="keyword">...</span>
2949     <span class="string">'WindowStyle'</span>,<span class="string">'modal'</span>, <span class="keyword">...</span>
2950     <span class="string">'MenuBar'</span>,<span class="string">'none'</span>, <span class="keyword">...</span>
2951     <span class="string">'ToolBar'</span>,<span class="string">'none'</span>, <span class="keyword">...</span>
2952     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
2953     <span class="string">'Position'</span>,[0 0 w h], <span class="keyword">...</span>
2954     <span class="string">'Resize'</span>,<span class="string">'off'</span>, <span class="keyword">...</span>
2955     <span class="string">'Visible'</span>,<span class="string">'off'</span>);
2956 dialog_params.english_units               = english_units;
2957 dialog_params.set_cross_section_endpoints = set_cross_section_endpoints;
2958 dialog_params.presentation                = plot_presentation_style; <span class="comment">%presentation;</span>
2959 dialog_params.print                       = plot_print_style; <span class="comment">%print;</span>
2960 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
2961 setappdata(handles.Figure,<span class="string">'original_dialog_params'</span>,dialog_params)
2962 
2963 <span class="comment">% Build the graphics:</span>
2964 <span class="comment">% -------------------</span>
2965 handles.UnitsPanel = uipanel(<span class="string">'Parent'</span>,handles.Figure, <span class="keyword">...</span>
2966     <span class="string">'Title'</span>, <span class="string">'Units'</span>, <span class="keyword">...</span>
2967     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
2968     <span class="string">'Position'</span>,[dx dy (w-3*dx)/3 h-dx-dy+10]);
2969 handles.UnitsMetric = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
2970     <span class="string">'Parent'</span>,handles.UnitsPanel, <span class="keyword">...</span>
2971     <span class="string">'String'</span>,<span class="string">'Metric'</span>, <span class="keyword">...</span>
2972     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
2973     <span class="string">'Position'</span>,[15 35 100 22]);
2974 handles.UnitsEnglish = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
2975     <span class="string">'Parent'</span>,handles.UnitsPanel, <span class="keyword">...</span>
2976     <span class="string">'String'</span>,<span class="string">'English'</span>, <span class="keyword">...</span>
2977     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
2978     <span class="string">'Position'</span>,[15 10 100 22]);
2979 
2980 handles.EndpointsPanel = uipanel(<span class="string">'Parent'</span>,handles.Figure, <span class="keyword">...</span>
2981     <span class="string">'Title'</span>, <span class="string">'Cross-Section Endpoints'</span>, <span class="keyword">...</span>
2982     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
2983     <span class="string">'Position'</span>,[(w+dx)/3 dy (w-3*dx)/3 h-dx-dy+10]);
2984 handles.EndpointsAutomatic = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
2985     <span class="string">'Parent'</span>,handles.EndpointsPanel, <span class="keyword">...</span>
2986     <span class="string">'String'</span>,<span class="string">'Automatic'</span>, <span class="keyword">...</span>
2987     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
2988     <span class="string">'Position'</span>,[15 35 100 22]);
2989 handles.EndpointsManual = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
2990     <span class="string">'Parent'</span>,handles.EndpointsPanel, <span class="keyword">...</span>
2991     <span class="string">'String'</span>,<span class="string">'Set Manually'</span>, <span class="keyword">...</span>
2992     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
2993     <span class="string">'Position'</span>,[15 10 100 22]);
2994 
2995 handles.StylePanel = uipanel(<span class="string">'Parent'</span>,handles.Figure, <span class="keyword">...</span>
2996     <span class="string">'Title'</span>, <span class="string">'Plot Style'</span>, <span class="keyword">...</span>
2997     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
2998     <span class="string">'Position'</span>,[w-w/3 dy (w-3*dx)/3 h-dx-dy+10]);
2999 handles.StylePresentation = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
3000     <span class="string">'Parent'</span>,handles.StylePanel, <span class="keyword">...</span>
3001     <span class="string">'String'</span>,<span class="string">'Presentation'</span>, <span class="keyword">...</span>
3002     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3003     <span class="string">'Position'</span>,[15 35 100 22]);
3004 handles.StylePrint = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
3005     <span class="string">'Parent'</span>,handles.StylePanel, <span class="keyword">...</span>
3006     <span class="string">'String'</span>,<span class="string">'Print'</span>, <span class="keyword">...</span>
3007     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3008     <span class="string">'Position'</span>,[15 10 100 22]);
3009 
3010 handles.OK = uicontrol(<span class="string">'Style'</span>,   <span class="string">'pushbutton'</span>, <span class="keyword">...</span>
3011     <span class="string">'Parent'</span>,  handles.Figure, <span class="keyword">...</span>
3012     <span class="string">'String'</span>,  <span class="string">'OK'</span>, <span class="keyword">...</span>
3013     <span class="string">'Units'</span>,   <span class="string">'pixels'</span>, <span class="keyword">...</span>
3014     <span class="string">'Position'</span>,[w/2-80-dx/4 6 80 22]);
3015 handles.Cancel = uicontrol(<span class="string">'Style'</span>,   <span class="string">'pushbutton'</span>, <span class="keyword">...</span>
3016     <span class="string">'Parent'</span>,  handles.Figure, <span class="keyword">...</span>
3017     <span class="string">'String'</span>,  <span class="string">'Cancel'</span>, <span class="keyword">...</span>
3018     <span class="string">'Units'</span>,   <span class="string">'pixels'</span>, <span class="keyword">...</span>
3019     <span class="string">'Position'</span>,[w/2+dx/4 6 80 22]);
3020 
3021 <span class="comment">% Update the UI controls:</span>
3022 <span class="comment">% -----------------------</span>
3023 <span class="keyword">if</span> dialog_params.english_units
3024     set(handles.UnitsMetric, <span class="string">'Value'</span>,0)
3025     set(handles.UnitsEnglish,<span class="string">'Value'</span>,1)
3026 <span class="keyword">else</span>
3027     set(handles.UnitsMetric, <span class="string">'Value'</span>,1)
3028     set(handles.UnitsEnglish,<span class="string">'Value'</span>,0)
3029 <span class="keyword">end</span>
3030 <span class="keyword">if</span> dialog_params.set_cross_section_endpoints
3031     set(handles.EndpointsAutomatic,<span class="string">'Value'</span>,0)
3032     set(handles.EndpointsManual,   <span class="string">'Value'</span>,1)
3033 <span class="keyword">else</span>
3034     set(handles.EndpointsAutomatic,<span class="string">'Value'</span>,1)
3035     set(handles.EndpointsManual,   <span class="string">'Value'</span>,0)
3036 <span class="keyword">end</span>
3037 <span class="keyword">if</span> dialog_params.presentation
3038     set(handles.StylePresentation, <span class="string">'Value'</span>,1)
3039     set(handles.StylePrint,        <span class="string">'Value'</span>,0)
3040 <span class="keyword">else</span>
3041     set(handles.StylePresentation, <span class="string">'Value'</span>,0)
3042     set(handles.StylePrint,        <span class="string">'Value'</span>,1)
3043 <span class="keyword">end</span>
3044 
3045 <span class="comment">% Set the callbacks:</span>
3046 <span class="comment">% ------------------</span>
3047 set(handles.Figure,            <span class="string">'CloseRequestFcn'</span>,{@<a href="#_sub94" class="code" title="subfunction dialogCloseReq(hObject,eventdata,h_OK)">dialogCloseReq</a>,handles.OK})
3048 set(handles.UnitsMetric,       <span class="string">'Callback'</span>,       {@<a href="#_sub89" class="code" title="subfunction dialogUnits(hObject,eventdata,handles,the_units)">dialogUnits</a>,    handles,<span class="string">'metric'</span>})
3049 set(handles.UnitsEnglish,      <span class="string">'Callback'</span>,       {@<a href="#_sub89" class="code" title="subfunction dialogUnits(hObject,eventdata,handles,the_units)">dialogUnits</a>,    handles,<span class="string">'english'</span>})
3050 set(handles.EndpointsAutomatic,<span class="string">'Callback'</span>,       {@<a href="#_sub90" class="code" title="subfunction dialogEnpoints(hObject,eventdata,handles,the_endpoints)">dialogEnpoints</a>, handles,<span class="string">'auto'</span>})
3051 set(handles.EndpointsManual,   <span class="string">'Callback'</span>,       {@<a href="#_sub90" class="code" title="subfunction dialogEnpoints(hObject,eventdata,handles,the_endpoints)">dialogEnpoints</a>, handles,<span class="string">'manual'</span>})
3052 set(handles.StylePresentation, <span class="string">'Callback'</span>,       {@<a href="#_sub91" class="code" title="subfunction dialogPlotStyle(hObject,eventdata,handles,the_style)">dialogPlotStyle</a>,handles,<span class="string">'presentation'</span>})
3053 set(handles.StylePrint,        <span class="string">'Callback'</span>,       {@<a href="#_sub91" class="code" title="subfunction dialogPlotStyle(hObject,eventdata,handles,the_style)">dialogPlotStyle</a>,handles,<span class="string">'print'</span>})
3054 set(handles.OK,                <span class="string">'Callback'</span>,       {@<a href="#_sub92" class="code" title="subfunction dialogOK(hObject,eventdata,h_OK)">dialogOK</a>,       handles.OK})
3055 set(handles.Cancel,            <span class="string">'Callback'</span>,       {@<a href="#_sub93" class="code" title="subfunction dialogCancel(hObject,eventdata,handles)">dialogCancel</a>,   handles})
3056 
3057 <span class="comment">% Position the dialog and make it visible:</span>
3058 <span class="comment">% ----------------------------------------</span>
3059 fpos = get(hf,<span class="string">'Position'</span>);
3060 dpos = [(fpos(1) + fpos(3)/2 -w/2) (fpos(2) + fpos(4)/2)];
3061 movegui(handles.Figure,dpos)
3062 set(handles.Figure,<span class="string">'Visible'</span>,<span class="string">'on'</span>)
3063 
3064 <span class="comment">% Hold the dialog open:</span>
3065 <span class="comment">% ---------------------</span>
3066 waitfor(handles.OK)
3067 
3068 <span class="comment">% Return the outputs and close the dialog:</span>
3069 <span class="comment">% ----------------------------------------</span>
3070 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3071 english_units = dialog_params.english_units;
3072 set_cross_section_endpoints = dialog_params.set_cross_section_endpoints;
3073 plot_presentation_style =  dialog_params.presentation;
3074 plot_print_style =  dialog_params.print;
3075 
3076 delete(handles.Figure)
3077 
3078 <span class="comment">% [EOF] plotParametersDialog</span>
3079 
3080 
3081 <span class="comment">% --------------------------------------------------------------------</span>
3082 <a name="_sub89" href="#_subfunctions" class="code">function dialogUnits(hObject,eventdata,handles,the_units)</a>
3083 
3084 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3085 <span class="keyword">switch</span> the_units
3086     <span class="keyword">case</span> <span class="string">'metric'</span>
3087         dialog_params.english_units = false;
3088         
3089         set(handles.UnitsMetric, <span class="string">'Value'</span>,1)
3090         set(handles.UnitsEnglish,<span class="string">'Value'</span>,0)
3091     <span class="keyword">case</span> <span class="string">'english'</span>
3092         dialog_params.english_units = true;
3093         
3094         set(handles.UnitsMetric, <span class="string">'Value'</span>,0)
3095         set(handles.UnitsEnglish,<span class="string">'Value'</span>,1)
3096     <span class="keyword">otherwise</span>
3097 <span class="keyword">end</span>
3098 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3099 
3100 <span class="comment">% [EOF] dialogUnits</span>
3101 
3102 <span class="comment">% --------------------------------------------------------------------</span>
3103 <a name="_sub90" href="#_subfunctions" class="code">function dialogEnpoints(hObject,eventdata,handles,the_endpoints)</a>
3104 
3105 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3106 <span class="keyword">switch</span> the_endpoints
3107     <span class="keyword">case</span> <span class="string">'auto'</span>
3108         dialog_params.set_cross_section_endpoints = false;
3109         
3110         set(handles.EndpointsAutomatic,<span class="string">'Value'</span>,1)
3111         set(handles.EndpointsManual,   <span class="string">'Value'</span>,0)
3112     <span class="keyword">case</span> <span class="string">'manual'</span>
3113         dialog_params.set_cross_section_endpoints = true;
3114         
3115         set(handles.EndpointsAutomatic,<span class="string">'Value'</span>,0)
3116         set(handles.EndpointsManual,   <span class="string">'Value'</span>,1)
3117     <span class="keyword">otherwise</span>
3118 <span class="keyword">end</span>
3119 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3120 
3121 <span class="comment">% [EOF] dialogEnpoints</span>
3122 
3123 <a name="_sub91" href="#_subfunctions" class="code">function dialogPlotStyle(hObject,eventdata,handles,the_style)</a>
3124 
3125 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3126 <span class="keyword">switch</span> the_style
3127     <span class="keyword">case</span> <span class="string">'presentation'</span>
3128         dialog_params.presentation  = true;
3129         dialog_params.print         = false;
3130         
3131         set(handles.StylePresentation,<span class="string">'Value'</span>,1)
3132         set(handles.StylePrint,       <span class="string">'Value'</span>,0)
3133     <span class="keyword">case</span> <span class="string">'print'</span>
3134         dialog_params.presentation  = false;
3135         dialog_params.print         = true;
3136         
3137         set(handles.StylePresentation,<span class="string">'Value'</span>,0)
3138         set(handles.StylePrint,       <span class="string">'Value'</span>,1)
3139     <span class="keyword">otherwise</span>
3140 <span class="keyword">end</span>
3141 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3142 
3143 <span class="comment">% [EOF] dialogEnpoints</span>
3144 
3145 <span class="comment">% --------------------------------------------------------------------</span>
3146 <a name="_sub92" href="#_subfunctions" class="code">function dialogOK(hObject,eventdata,h_OK)</a>
3147 
3148 delete(h_OK)
3149 
3150 <span class="comment">% [EOF] dialogOK</span>
3151 
3152 <span class="comment">% --------------------------------------------------------------------</span>
3153 <a name="_sub93" href="#_subfunctions" class="code">function dialogCancel(hObject,eventdata,handles)</a>
3154 <span class="comment">% Return the original inputs</span>
3155 dialog_params = getappdata(handles.Figure,<span class="string">'original_dialog_params'</span>);
3156 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3157 delete(handles.OK)
3158 
3159 <span class="comment">% [EOF] dialogCancel</span>
3160 
3161 <span class="comment">% --------------------------------------------------------------------</span>
3162 <a name="_sub94" href="#_subfunctions" class="code">function dialogCloseReq(hObject,eventdata,h_OK)</a>
3163 
3164 delete(h_OK)
3165 
3166 <span class="comment">% [EOF] dialogCloseReq</span>
3167 
3168 <a name="_sub95" href="#_subfunctions" class="code">function [beam_angle,magnetic_variation,wse,output_auxilliary_data] = exportSettingsDialog(beam_angle,magnetic_variation,wse,output_auxilliary_data,hf)</a>
3169 w = 230;
3170 h = 200;
3171 dx = 10;
3172 dy = 35;
3173 the_color = get(0,<span class="string">'factoryUipanelBackgroundColor'</span>);
3174 handles.Figure = figure(<span class="string">'Name'</span>, <span class="string">'Export Settings'</span>, <span class="keyword">...</span>
3175     <span class="string">'Color'</span>,the_color, <span class="keyword">...</span>
3176     <span class="string">'NumberTitle'</span>,<span class="string">'off'</span>, <span class="keyword">...</span>
3177     <span class="string">'HandleVisibility'</span>,<span class="string">'callback'</span>, <span class="keyword">...</span>
3178     <span class="string">'WindowStyle'</span>,<span class="string">'modal'</span>, <span class="keyword">...</span>
3179     <span class="string">'MenuBar'</span>,<span class="string">'none'</span>, <span class="keyword">...</span>
3180     <span class="string">'ToolBar'</span>,<span class="string">'none'</span>, <span class="keyword">...</span>
3181     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3182     <span class="string">'Position'</span>,[0 0 w h], <span class="keyword">...</span>
3183     <span class="string">'Resize'</span>,<span class="string">'off'</span>, <span class="keyword">...</span>
3184     <span class="string">'Visible'</span>,<span class="string">'off'</span>);
3185 dialog_params.beam_angle             = beam_angle;
3186 dialog_params.magnetic_variation     = magnetic_variation;
3187 dialog_params.wse                    = wse;
3188 dialog_params.output_auxilliary_data = output_auxilliary_data;
3189 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3190 setappdata(handles.Figure,<span class="string">'original_dialog_params'</span>,dialog_params)
3191 
3192 <span class="comment">% Build the graphics:</span>
3193 <span class="comment">% -------------------</span>
3194 ph = 150;
3195 handles.BathymetryPanel = uipanel(<span class="string">'Parent'</span>,handles.Figure, <span class="keyword">...</span>
3196     <span class="string">'Title'</span>, <span class="string">'Bathymetry'</span>, <span class="keyword">...</span>
3197     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3198     <span class="string">'Position'</span>,[dx dy (w-2*dx) h-dx-dy+10]);
3199 handles.BeamAngleText = uicontrol(<span class="string">'Style'</span>,<span class="string">'text'</span>, <span class="keyword">...</span>
3200     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3201     <span class="string">'String'</span>,<span class="string">'Beam Angle (deg)'</span>, <span class="keyword">...</span>
3202     <span class="keyword">...</span><span class="comment">'Value',beam_angle,...</span>
3203     <span class="string">'HorizontalAlignment'</span>,<span class="string">'right'</span>,<span class="keyword">...</span>
3204     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3205     <span class="string">'Position'</span>,[dx+5 h-ph+60-4 100 22]);
3206 handles.BeamAngle = uicontrol(<span class="string">'Style'</span>,<span class="string">'edit'</span>, <span class="keyword">...</span>
3207     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3208     <span class="keyword">...</span><span class="comment">'String','Beam Angle (deg)', ...</span>
3209     <span class="string">'String'</span>,beam_angle,<span class="keyword">...</span>
3210     <span class="string">'BackgroundColor'</span>,<span class="string">'w'</span>,<span class="keyword">...</span>
3211     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3212     <span class="string">'Position'</span>,[w-dx-80 h-ph+60 50 22]);
3213 handles.MagneticVariationText = uicontrol(<span class="string">'Style'</span>,<span class="string">'text'</span>, <span class="keyword">...</span>
3214     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3215     <span class="string">'String'</span>,<span class="string">'Magnetic Variation'</span>, <span class="keyword">...</span>
3216     <span class="keyword">...</span><span class="comment">'Value',beam_angle,...</span>
3217     <span class="string">'HorizontalAlignment'</span>,<span class="string">'right'</span>,<span class="keyword">...</span>
3218     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3219     <span class="string">'Position'</span>,[dx+5 h-ph+30-4 100 22]);
3220 handles.MagneticVariation = uicontrol(<span class="string">'Style'</span>,<span class="string">'edit'</span>, <span class="keyword">...</span>
3221     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3222     <span class="keyword">...</span><span class="comment">'String','Magnetic Variation', ...</span>
3223     <span class="string">'String'</span>,magnetic_variation,<span class="keyword">...</span>
3224     <span class="string">'BackgroundColor'</span>,<span class="string">'w'</span>,<span class="keyword">...</span>
3225     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3226     <span class="string">'Position'</span>,[w-dx-80 h-ph+30 50 22]);
3227 handles.WSEText = uicontrol(<span class="string">'Style'</span>,<span class="string">'text'</span>, <span class="keyword">...</span>
3228     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3229     <span class="string">'String'</span>,<span class="string">'WSE (m)'</span>, <span class="keyword">...</span>
3230     <span class="keyword">...</span><span class="comment">'Value',beam_angle,...</span>
3231     <span class="string">'HorizontalAlignment'</span>,<span class="string">'right'</span>,<span class="keyword">...</span>
3232     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3233     <span class="string">'Position'</span>,[dx+5 h-ph-4 100 22]);
3234 handles.WSE = uicontrol(<span class="string">'Style'</span>,<span class="string">'edit'</span>, <span class="keyword">...</span>
3235     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3236     <span class="keyword">...</span><span class="comment">'String','Magnetic Variation', ...</span>
3237     <span class="string">'String'</span>,wse,<span class="keyword">...</span>
3238     <span class="string">'BackgroundColor'</span>,<span class="string">'w'</span>,<span class="keyword">...</span>
3239     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3240     <span class="string">'Position'</span>,[w-dx-80 h-ph 50 22]);
3241 handles.OutputAuxilliaryData = uicontrol(<span class="string">'Style'</span>,<span class="string">'checkbox'</span>, <span class="keyword">...</span>
3242     <span class="string">'Parent'</span>,handles.BathymetryPanel, <span class="keyword">...</span>
3243     <span class="string">'String'</span>,<span class="string">'Output Auxilliary Data'</span>, <span class="keyword">...</span>
3244     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3245     <span class="string">'Position'</span>,[dx+5 20 w-2*dx-30 22]);
3246 handles.OK = uicontrol(<span class="string">'Style'</span>,   <span class="string">'pushbutton'</span>, <span class="keyword">...</span>
3247     <span class="string">'Parent'</span>,  handles.Figure, <span class="keyword">...</span>
3248     <span class="string">'String'</span>,  <span class="string">'OK'</span>, <span class="keyword">...</span>
3249     <span class="string">'Units'</span>,   <span class="string">'pixels'</span>, <span class="keyword">...</span>
3250     <span class="string">'Position'</span>,[w/2-80-dx/4 6 80 22]);
3251 handles.Cancel = uicontrol(<span class="string">'Style'</span>,   <span class="string">'pushbutton'</span>, <span class="keyword">...</span>
3252     <span class="string">'Parent'</span>,  handles.Figure, <span class="keyword">...</span>
3253     <span class="string">'String'</span>,  <span class="string">'Cancel'</span>, <span class="keyword">...</span>
3254     <span class="string">'Units'</span>,   <span class="string">'pixels'</span>, <span class="keyword">...</span>
3255     <span class="string">'Position'</span>,[w/2+dx/4 6 80 22]);
3256 
3257 <span class="comment">% Update the UI controls:</span>
3258 <span class="comment">% -----------------------</span>
3259 set(handles.BeamAngle,                <span class="string">'String'</span>,dialog_params.beam_angle)
3260 set(handles.MagneticVariation,        <span class="string">'String'</span>,dialog_params.magnetic_variation)
3261 set(handles.WSE,                      <span class="string">'String'</span>,dialog_params.wse)
3262 set(handles.OutputAuxilliaryData,     <span class="string">'Value'</span>,dialog_params.output_auxilliary_data)
3263 
3264 <span class="comment">% Set the callbacks:</span>
3265 <span class="comment">% ------------------</span>
3266 set(handles.Figure,                      <span class="string">'CloseRequestFcn'</span>,{@<a href="#_sub94" class="code" title="subfunction dialogCloseReq(hObject,eventdata,h_OK)">dialogCloseReq</a>,handles.OK})
3267 set(handles.BeamAngle,                   <span class="string">'Callback'</span>,       {@<a href="#_sub96" class="code" title="subfunction dialogExportSettings(hObject,eventdata,handles)">dialogExportSettings</a>,handles})
3268 set(handles.MagneticVariation,           <span class="string">'Callback'</span>,       {@<a href="#_sub96" class="code" title="subfunction dialogExportSettings(hObject,eventdata,handles)">dialogExportSettings</a>,handles})
3269 set(handles.WSE,                         <span class="string">'Callback'</span>,       {@<a href="#_sub96" class="code" title="subfunction dialogExportSettings(hObject,eventdata,handles)">dialogExportSettings</a>,handles})
3270 set(handles.OutputAuxilliaryData,        <span class="string">'Callback'</span>,       {@<a href="#_sub96" class="code" title="subfunction dialogExportSettings(hObject,eventdata,handles)">dialogExportSettings</a>,handles})
3271 set(handles.OK,                          <span class="string">'Callback'</span>,       {@<a href="#_sub92" class="code" title="subfunction dialogOK(hObject,eventdata,h_OK)">dialogOK</a>,      handles.OK})
3272 set(handles.Cancel,                      <span class="string">'Callback'</span>,       {@<a href="#_sub93" class="code" title="subfunction dialogCancel(hObject,eventdata,handles)">dialogCancel</a>,  handles})
3273 
3274 <span class="comment">% Position the dialog and make it visible:</span>
3275 <span class="comment">% ----------------------------------------</span>
3276 fpos = get(hf,<span class="string">'Position'</span>);
3277 dpos = [(fpos(1) + fpos(3)/2 -w/2) (fpos(2) + fpos(4)/2)];
3278 movegui(handles.Figure,dpos)
3279 set(handles.Figure,<span class="string">'Visible'</span>,<span class="string">'on'</span>)
3280 
3281 <span class="comment">% Hold the dialog open:</span>
3282 <span class="comment">% ---------------------</span>
3283 waitfor(handles.OK)
3284 
3285 <span class="comment">% Return the outputs and close the dialog:</span>
3286 <span class="comment">% ----------------------------------------</span>
3287 dialog_params           = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3288 beam_angle              = dialog_params.beam_angle;
3289 magnetic_variation      = dialog_params.magnetic_variation;
3290 wse                     = dialog_params.wse;
3291 output_auxilliary_data  = dialog_params.output_auxilliary_data;
3292 
3293 delete(handles.Figure)
3294 
3295 <span class="comment">% [EOF] exportSettingsDialog</span>
3296 
3297 <span class="comment">% --------------------------------------------------------------------</span>
3298 <a name="_sub96" href="#_subfunctions" class="code">function dialogExportSettings(hObject,eventdata,handles)</a>
3299 
3300 <span class="comment">% Grab the current data</span>
3301 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3302 
3303 <span class="comment">% Set it according to the dialog box values</span>
3304 dialog_params.beam_angle                = get(handles.BeamAngle,<span class="string">'String'</span>);
3305 dialog_params.magnetic_variation        = get(handles.MagneticVariation,<span class="string">'String'</span>);
3306 dialog_params.wse                       = get(handles.WSE,<span class="string">'String'</span>);
3307 dialog_params.output_auxilliary_data    = get(handles.OutputAuxilliaryData,<span class="string">'Value'</span>);
3308 
3309 <span class="comment">% Re-store the application data</span>
3310 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3311 
3312 <span class="comment">% [EOF] dialogExportSettings</span>
3313 
3314 <a name="_sub97" href="#_subfunctions" class="code">function [selected_figures] = openFiguresDialog(figure_names,hf)</a>
3315 
3316 w = 230;
3317 h = 200;
3318 dx = 10;
3319 dy = 35;
3320 the_color = get(0,<span class="string">'factoryUipanelBackgroundColor'</span>);
3321 handles.Figure = figure(<span class="string">'Name'</span>, <span class="string">'Select open figures to export'</span>, <span class="keyword">...</span>
3322     <span class="string">'Color'</span>,the_color, <span class="keyword">...</span>
3323     <span class="string">'NumberTitle'</span>,<span class="string">'off'</span>, <span class="keyword">...</span>
3324     <span class="string">'HandleVisibility'</span>,<span class="string">'callback'</span>, <span class="keyword">...</span>
3325     <span class="string">'WindowStyle'</span>,<span class="string">'modal'</span>, <span class="keyword">...</span>
3326     <span class="string">'MenuBar'</span>,<span class="string">'none'</span>, <span class="keyword">...</span>
3327     <span class="string">'ToolBar'</span>,<span class="string">'none'</span>, <span class="keyword">...</span>
3328     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3329     <span class="string">'Position'</span>,[0 0 w h], <span class="keyword">...</span>
3330     <span class="string">'Resize'</span>,<span class="string">'off'</span>, <span class="keyword">...</span>
3331     <span class="string">'Visible'</span>,<span class="string">'off'</span>);
3332 dialog_params.figure_names               = figure_names;
3333 dialog_params.selected_figures           = <span class="string">''</span>;
3334 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3335 setappdata(handles.Figure,<span class="string">'original_dialog_params'</span>,dialog_params)
3336 
3337 <span class="comment">% Build the graphics:</span>
3338 <span class="comment">% -------------------</span>
3339 handles.ListboxPanel = uipanel(<span class="string">'Parent'</span>,handles.Figure, <span class="keyword">...</span>
3340     <span class="string">'Title'</span>, <span class="string">'Figures'</span>, <span class="keyword">...</span>
3341     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3342     <span class="string">'Position'</span>,[dx dy (w-2*dx) h-dx-dy+10]);
3343 handles.Figures = uicontrol(<span class="string">'Style'</span>,<span class="string">'listbox'</span>, <span class="keyword">...</span>
3344     <span class="string">'Parent'</span>,handles.ListboxPanel, <span class="keyword">...</span>
3345     <span class="string">'BackGroundColor'</span>,<span class="string">'white'</span>,<span class="keyword">...</span>
3346     <span class="string">'String'</span>,figure_names, <span class="keyword">...</span>
3347     <span class="string">'Min'</span>, 0,<span class="keyword">...</span>
3348     <span class="string">'Max'</span>, 2,<span class="keyword">...</span>
3349     <span class="string">'Units'</span>,<span class="string">'pixels'</span>, <span class="keyword">...</span>
3350     <span class="string">'Position'</span>,[15 35 (w-5*dx) 100]);
3351 
3352 
3353 handles.OK = uicontrol(<span class="string">'Style'</span>,   <span class="string">'pushbutton'</span>, <span class="keyword">...</span>
3354     <span class="string">'Parent'</span>,  handles.Figure, <span class="keyword">...</span>
3355     <span class="string">'String'</span>,  <span class="string">'OK'</span>, <span class="keyword">...</span>
3356     <span class="string">'Units'</span>,   <span class="string">'pixels'</span>, <span class="keyword">...</span>
3357     <span class="string">'Position'</span>,[w/2-80-dx/4 6 80 22]);
3358 handles.Cancel = uicontrol(<span class="string">'Style'</span>,   <span class="string">'pushbutton'</span>, <span class="keyword">...</span>
3359     <span class="string">'Parent'</span>,  handles.Figure, <span class="keyword">...</span>
3360     <span class="string">'String'</span>,  <span class="string">'Cancel'</span>, <span class="keyword">...</span>
3361     <span class="string">'Units'</span>,   <span class="string">'pixels'</span>, <span class="keyword">...</span>
3362     <span class="string">'Position'</span>,[w/2+dx/4 6 80 22]);
3363 
3364 <span class="comment">% Update the UI controls:</span>
3365 <span class="comment">% -----------------------</span>
3366 
3367 
3368 <span class="comment">% Set the callbacks:</span>
3369 <span class="comment">% ------------------</span>
3370 set(handles.Figure,            <span class="string">'CloseRequestFcn'</span>,{@<a href="#_sub94" class="code" title="subfunction dialogCloseReq(hObject,eventdata,h_OK)">dialogCloseReq</a>,handles.OK})
3371 set(handles.Figures,           <span class="string">'Callback'</span>,       {@<a href="#_sub98" class="code" title="subfunction dialogSelectFigures(hObject,eventdata,handles)">dialogSelectFigures</a>    handles})
3372 set(handles.OK,                <span class="string">'Callback'</span>,       {@<a href="#_sub92" class="code" title="subfunction dialogOK(hObject,eventdata,h_OK)">dialogOK</a>,       handles.OK})
3373 set(handles.Cancel,            <span class="string">'Callback'</span>,       {@<a href="#_sub93" class="code" title="subfunction dialogCancel(hObject,eventdata,handles)">dialogCancel</a>,   handles})
3374 
3375 <span class="comment">% Position the dialog and make it visible:</span>
3376 <span class="comment">% ----------------------------------------</span>
3377 fpos = get(hf,<span class="string">'Position'</span>);
3378 dpos = [(fpos(1) + fpos(3)/2 -w/2) (fpos(2) + fpos(4)/2)];
3379 movegui(handles.Figure,dpos)
3380 set(handles.Figure,<span class="string">'Visible'</span>,<span class="string">'on'</span>)
3381 
3382 <span class="comment">% Hold the dialog open:</span>
3383 <span class="comment">% ---------------------</span>
3384 waitfor(handles.OK)
3385 
3386 <span class="comment">% Return the outputs and close the dialog:</span>
3387 <span class="comment">% ----------------------------------------</span>
3388 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3389 selected_figures = dialog_params.selected_figures;
3390 
3391 delete(handles.Figure)
3392 
3393 <span class="comment">% [EOF] openFiguresDialog</span>
3394 
3395 <span class="comment">% --------------------------------------------------------------------</span>
3396 <a name="_sub98" href="#_subfunctions" class="code">function dialogSelectFigures(hObject,eventdata,handles)</a>
3397 
3398 dialog_params = getappdata(handles.Figure,<span class="string">'dialog_params'</span>);
3399 
3400 idx_selected = get(handles.Figures,<span class="string">'Value'</span>);
3401 fig_names    = get(handles.Figures,<span class="string">'String'</span>);
3402 selected     = fig_names(idx_selected);
3403 dialog_params.selected_figures = selected;
3404 
3405 setappdata(handles.Figure,<span class="string">'dialog_params'</span>,dialog_params)
3406 
3407 
3408 
3409 <span class="comment">% --------------------------------------------------------------------</span>
3410 <a name="_sub99" href="#_subfunctions" class="code">function icons = getIcons</a>
3411 
3412 <span class="comment">% Load data</span>
3413 idx = 1;
3414 icons(idx).data(:,:,1) = <span class="keyword">...</span>
3415     [NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN
3416     NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   129   120   135   188   NaN   NaN   NaN
3417     NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN    96   189   NaN   NaN   130   NaN    95   NaN
3418     NaN   NaN   206   206   206   206   NaN   NaN   NaN   NaN   NaN   NaN   NaN    84    79   NaN
3419     NaN   206   255   255   255   255   198   197   NaN   NaN   NaN   NaN    83    79    76   NaN
3420     198   255   255   255   255   255   255   198   198   198   198   198   198   212   212   NaN
3421     198   255   255   255   255   255   255   255   255   255   255   255   198   157   197   NaN
3422     198   255   226   198   198   198   198   198   198   198   198   198   198   198   177   NaN
3423     198   255   198   218   255   255   255   255   255   255   255   255   255   255   161   NaN
3424     198   253   198   247   255   255   255   255   255   255   255   255   255   251   155   NaN
3425     198   226   201   255   255   255   255   255   255   255   255   255   231   206   165   NaN
3426     198   207   215   255   255   255   255   255   255   255   255   255   239   198   159   NaN
3427     198   198   240   255   255   255   255   255   255   255   255   255   222   157   159   NaN
3428     198   199   255   255   255   255   255   255   255   255   255   255   191   165   159   NaN
3429     NaN   165   165   165   165   165   165   165   165   165   165   165   165   159   159   NaN
3430     NaN   NaN   159   159   159   159   159   159   159   159   159   159   159   159   NaN   NaN]/255;
3431 
3432 icons(idx).data(:,:,2) = <span class="keyword">...</span>
3433     [NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN
3434     NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   145   137   149   195   NaN   NaN   NaN
3435     NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   116   196   NaN   NaN   145   NaN   116   NaN
3436     NaN   NaN   162   162   162   162   NaN   NaN   NaN   NaN   NaN   NaN   NaN   107   105   NaN
3437     NaN   162   255   255   255   255   154   197   NaN   NaN   NaN   NaN   106   104   103   NaN
3438     154   255   255   255   255   255   255   154   154   154   154   154   154   208   208   NaN
3439     154   243   243   243   243   243   243   255   255   255   255   255   154   123   197   NaN
3440     154   235   193   154   154   154   154   154   154   154   154   154   154   154   137   NaN
3441     154   215   154   191   255   255   251   255   255   255   255   255   231   255   126   NaN
3442     154   213   154   240   255   255   255   255   255   255   255   255   199   249   123   NaN
3443     154   179   160   255   247   247   247   247   247   247   247   247   190   188   115   NaN
3444     154   162   184   255   235   235   235   235   235   235   235   231   186   154   169   NaN
3445     154   154   228   255   227   227   227   227   227   227   227   223   178   123   169   NaN
3446     154   156   255   215   215   215   215   215   215   215   215   215   153   115   169   NaN
3447     NaN   115   115   115   115   115   115   115   115   115   115   115   115   169   169   NaN
3448     NaN   NaN   169   169   169   169   169   169   169   169   169   169   169   169   NaN   NaN]/255;
3449 
3450 icons(idx).data(:,:,3) = <span class="keyword">...</span>
3451     [NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN
3452     NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   166   161   170   202   NaN   NaN   NaN
3453     NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN   149   205   NaN   NaN   166   NaN   148   NaN
3454     NaN   NaN    34    34    34    34   NaN   NaN   NaN   NaN   NaN   NaN   NaN   141   144   NaN
3455     NaN    34   255   255   255   255    25   197   NaN   NaN   NaN   NaN   142   145   147   NaN
3456     25   255   156   156   156   156   255    25    25    25    25    25    25   200   200   NaN
3457     25   156   140   140   140   140   140   255   255   255   255   255    25    26   197   NaN
3458     25   132    80    25    25    25    25    25    25    25    25    25    25    25    25   NaN
3459     25   132    25   108   255   255   247   255   255   255   255   255   132   255    25   NaN
3460     25   112    25   137   156   156   156   156   156   156   156   156    91   150    25   NaN
3461     25    67    33   165   148   148   148   148   148   148   148   148    83    92    13   NaN
3462     25    38    64   156   132   132   132   132   132   132   132   132    67    25   176   NaN
3463     25    26   122   156   124   124   124   124   124   124   124   124    67    26   176   NaN
3464     25    28   156   108   108   108   108   108   108   108   108   108    41    13   176   NaN
3465     NaN    13    13    13    13    13    13    13    13    13    13    13    13   176   176   NaN
3466     NaN   NaN   176   176   176   176   176   176   176   176   176   176   176   176   NaN   NaN]/255;
3467 
3468 <span class="comment">% Save data</span>
3469 idx = idx+1;
3470 icons(idx).data(:,:,1) = <span class="keyword">...</span>
3471     [NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN
3472     NaN    0.6902    0.6902    0.6902    0.6902    0.6902    0.6274    0.6274    0.5647    0.5647    0.5647    0.5019    0.5019    0.4392    0.2510       NaN
3473     NaN    0.6902    0.7529    0.5647    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.9412    0.3137    0.3765    0.2510    0.4670
3474     NaN    0.6902    0.7529    0.5647    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.9412    0.9412    0.2510    0.1882    0.2510    0.4670
3475     NaN    0.6274    0.7529    0.5019    1.0000    1.0000    1.0000    1.0000    1.0000    0.9412    0.9412    0.8784    0.1882    0.5019    0.2510    0.4670
3476     NaN    0.6274    0.7529    0.4392    1.0000    1.0000    1.0000    1.0000    0.9412    0.9412    0.8784    0.8157    0.1882    0.4392    0.2510    0.4670
3477     NaN    0.6274    0.7529    0.4392    1.0000    1.0000    1.0000    0.9412    0.9412    0.8784    0.8157    0.7529    0.1255    0.3765    0.2510    0.4670
3478     NaN    0.5647    0.7529    0.3765    1.0000    1.0000    0.9412    0.9412    0.8784    0.8157    0.7529    0.7529    0.0627    0.3765    0.2510    0.4670
3479     NaN    0.5647    0.7529    0.6902    0.3765    0.3137    0.3137    0.2510    0.1882    0.1882    0.1255    0.0627    0.3765    0.3137    0.2510    0.4670
3480     NaN    0.5019    0.6902    0.6902    0.6274    0.5647    0.5019    0.5019    0.5019    0.4392    0.4392    0.3765    0.3137    0.3137    0.2510    0.4670
3481     NaN    0.5019    0.6902    0.6274    0.5647    0.3137    0.3137    0.3137    0.3137    0.3137    0.3765    0.3137    0.3137    0.2510    0.2510    0.4670
3482     NaN    0.4392    0.6274    0.5647    0.5019    0.3137       NaN    0.1882    0.8157    0.8157    0.3765    0.2510    0.2510    0.2510    0.2510    0.4670
3483     NaN    0.4392    0.6274    0.5019    0.5019    0.3137    0.1882    0.4392    0.8784    0.8784    0.4392    0.1882    0.2510    0.1882    0.2510    0.4670
3484     NaN    0.4392    0.5647    0.5019    0.1255    0.1255    0.6902    0.6902    0.7529    0.7529    0.3137    0.1882    0.1882    0.1882    0.2510    0.4670
3485     NaN    0.7333    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.2510    0.4670
3486     NaN       NaN    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670    0.4670];
3487 
3488 icons(idx).data(:,:,2) = <span class="keyword">...</span>
3489     [NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN
3490     NaN    0.7216    0.7216    0.6902    0.6902    0.6588    0.6274    0.5961    0.5647    0.5647    0.5333    0.5019    0.4706    0.4706    0.2196       NaN
3491     NaN    0.6902    0.7529    0.5647    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.9725    0.3451    0.3451    0.2196    0.5378
3492     NaN    0.6902    0.7529    0.5333    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.9725    0.9412    0.3137    0.1882    0.2196    0.5378
3493     NaN    0.6588    0.7529    0.5019    1.0000    1.0000    1.0000    1.0000    1.0000    0.9725    0.9412    0.9098    0.3137    0.4706    0.2196    0.5378
3494     NaN    0.6274    0.7529    0.4706    1.0000    1.0000    1.0000    1.0000    0.9725    0.9412    0.9098    0.8470    0.2824    0.4392    0.2196    0.5378
3495     NaN    0.5961    0.7529    0.4392    1.0000    1.0000    1.0000    0.9725    0.9412    0.9098    0.8470    0.8157    0.2510    0.4078    0.2196    0.5378
3496     NaN    0.5647    0.7529    0.4078    1.0000    1.0000    0.9725    0.9412    0.9098    0.8470    0.8157    0.7843    0.2196    0.3765    0.2196    0.5378
3497     NaN    0.5333    0.7216    0.7216    0.3765    0.3765    0.3451    0.3137    0.3137    0.2824    0.2510    0.2196    0.3765    0.3451    0.2196    0.5378
3498     NaN    0.5019    0.6902    0.6902    0.6274    0.5647    0.5333    0.5019    0.4706    0.4392    0.4078    0.3765    0.3451    0.3137    0.2196    0.5378
3499     NaN    0.4706    0.6588    0.6274    0.5647    0.3451    0.3451    0.3451    0.3451    0.3765    0.4078    0.3451    0.3137    0.2824    0.2196    0.5378
3500     NaN    0.4706    0.6274    0.5647    0.5333    0.3451       NaN    0.2510    0.8470    0.8784    0.4706    0.2824    0.2824    0.2510    0.2196    0.5378
3501     NaN    0.4392    0.5961    0.5333    0.5019    0.3451    0.2510    0.4706    0.8784    0.9098    0.5019    0.2510    0.2510    0.2510    0.2196    0.5378
3502     NaN    0.4078    0.5647    0.5019    0.2824    0.1882    0.7216    0.7216    0.7529    0.7843    0.3137    0.2510    0.2510    0.2196    0.2196    0.5378
3503     NaN    0.7176    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.2196    0.5378
3504     NaN       NaN    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378    0.5378];
3505 
3506 icons(idx).data(:,:,3) = <span class="keyword">...</span>
3507     [NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN       NaN
3508     NaN    0.9412    0.9412    0.9412    0.9412    0.9412    0.9412    0.8784    0.8784    0.8784    0.8784    0.8784    0.8157    0.8157    0.4392       NaN
3509     NaN    0.9412    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.7529    0.6902    0.4392    0.5997
3510     NaN    0.9412    1.0000    0.9412    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.9412    0.7529    0.3765    0.4392    0.5997
3511     NaN    0.9412    1.0000    0.8784    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.9412    0.9412    0.6902    0.8784    0.4392    0.5997
3512     NaN    0.9412    1.0000    0.8784    1.0000    1.0000    1.0000    1.0000    1.0000    0.9412    0.9412    0.9412    0.6902    0.8157    0.4392    0.5997
3513     NaN    0.8784    1.0000    0.8157    1.0000    1.0000    1.0000    1.0000    0.9412    0.9412    0.9412    0.8784    0.6274    0.8157    0.4392    0.5997
3514     NaN    0.8784    1.0000    0.8157    1.0000    1.0000    1.0000    0.9412    0.9412    0.9412    0.8784    0.8784    0.6274    0.7529    0.4392    0.5997
3515     NaN    0.8784    1.0000    1.0000    0.8157    0.7529    0.7529    0.7529    0.6902    0.6902    0.6274    0.6274    0.7529    0.7529    0.4392    0.5997
3516     NaN    0.8784    1.0000    1.0000    1.0000    0.9412    0.9412    0.8784    0.8784    0.8157    0.8157    0.7529    0.7529    0.6902    0.4392    0.5997
3517     NaN    0.8157    1.0000    1.0000    0.9412    0.4392    0.4392    0.4392    0.4392    0.4392    0.5019    0.7529    0.6902    0.6902    0.4392    0.5997
3518     NaN    0.8157    1.0000    0.9412    0.9412    0.4392       NaN    0.2510    0.9412    0.9412    0.5019    0.6902    0.6902    0.6274    0.4392    0.5997
3519     NaN    0.8157    1.0000    0.9412    0.8784    0.4392    0.2510    0.5647    0.9412    0.9412    0.5647    0.6274    0.6274    0.6274    0.4392    0.5997
3520     NaN    0.8157    0.9412    0.8784    0.6902    0.2510    0.7529    0.7529    0.8157    0.8157    0.3137    0.6274    0.6274    0.6274    0.4392    0.5997
3521     NaN    0.8275    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.4392    0.5997
3522     NaN       NaN    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997    0.5997];
3523 
3524 <span class="comment">% Plotting parameters</span>
3525 idx = idx+1;
3526 icons(idx).data(:,:,1) = <span class="keyword">...</span>
3527     [  0     0     0     0     0     0     0     0     0     0     0     0     0     0     0   255
3528     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3529     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   165
3530     0   255   203    79   213   255   255   255   255   255   254   160   109   247     0   165
3531     0   254    71   224    79   255   255   255   255   255   211   101   165   123     0   165
3532     0   191   123   255   123   203   255   255   255   255   101   224   254    79     0   165
3533     0   101   239   255   224   109   255   255   255   247    79   254   254   123    36   165
3534     0   123   254   255   255    79   247   255   255   165   165   255   255   224     0   165
3535     0   255   255   255   254   160   173   255   255    87   239   255   255   255     0   165
3536     0   255   255   255   255   224   101   255   239    87   255   255   255   255     0   165
3537     0   255   255   255   255   255   101   224   123   191   255   255   255   255     0   165
3538     0   255   255   255   255   254   224    54   101   255   255   255   255   255     0   165
3539     0   255   255   255   255   255   255   247   255   255   255   255   255   255     0   165
3540     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   165
3541     0     0     0     1     0     0     0     0     0     0     0     0     0     0     0   165
3542     255   165   165   165   172   165   165   165   165   165   165   165   165   165   165   165]/255;
3543 
3544 icons(idx).data(:,:,2) = <span class="keyword">...</span>
3545     [  0     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
3546     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0     0
3547     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   165
3548     0   255   203    79   213   255   255   255   255   255   254   160   109   247     0   165
3549     0   254    71   224    79   255   255   255   255   255   211   101   165   123     0   165
3550     0   191   123   255   123   203   255   255   255   255   101   224   254    79     0   165
3551     0   101   239   255   224   109   255   255   255   247    79   254   254   123     0   165
3552     0   123   254   255   255    79   247   255   255   165   165   255   255   224     0   165
3553     0   255   255   255   254   160   173   255   255    87   239   255   255   255     0   165
3554     0   255   255   255   255   224   101   255   239    87   255   255   255   255     0   165
3555     0   255   255   255   255   255   101   224   123   191   255   255   255   255     0   165
3556     0   255   255   255   255   254   224    54   101   255   255   255   255   255     0   165
3557     0   255   255   255   255   255   255   247   255   255   255   255   255   255     0   165
3558     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   165
3559     0     0     0     0     0     0     0     0     0     0     0     0     0     0     0   165
3560     0   165   165   165   153   165   165   165   165   165   165   165   165   165   165   165]/255;
3561 
3562 icons(idx).data(:,:,3) = <span class="keyword">...</span>
3563     [  0     0     0     0     0     0     0     0     0     0     0     0     0     0     0   255
3564     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3565     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3566     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3567     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3568     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3569     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3570     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3571     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3572     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3573     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3574     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3575     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3576     0   255   255   255   255   255   255   255   255   255   255   255   255   255     0   145
3577     0    24    39     0     0     0     0     0     0     0     0     0     0     0     0   145
3578     255   145   145   145   134   145   145   145   145   145   145   145   145   145   145   145]/255;
3579 
3580 <span class="comment">% Processing parameters</span>
3581 idx = idx+1;
3582 icons(idx).data(:,:,1) = <span class="keyword">...</span>
3583     [255   255   255   255   255   255   255   255   255   255   255   255   255   255   255   255
3584     255     0     0     0   255   255   255   255   255   255   255   255     0     0     0   255
3585     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3586     255     0   255   255   107   255   255   107   255   255   255   107   255   255     0   255
3587     255     0   255   255   107   255   255   107   255   255   107   255   107   255     0   255
3588     255     0   255   255   107   255   255   107   255   255   255   107   255   255     0   255
3589     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3590     255     0   255   255   107   255   255   107   255   255   255   107   255   255     0   255
3591     255     0   255   255   107   255   107   255   107   255   255   107   255   255     0   255
3592     255     0   255   255   107   255   255   107   255   255   255   107   255   255     0   255
3593     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3594     255     0   255   255   107   255   255   107   255   255   255   107   255   255     0   255
3595     255     0   255   107   255   107   255   107   255   255   107   255   107   255     0   255
3596     255     0   255   255   107   255   255   107   255   255   255   107   255   255     0   255
3597     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3598     255     0     0     0   255   255   255   255   255   255   255   255     0     0     0   255]/255;
3599 
3600 icons(idx).data(:,:,2) = <span class="keyword">...</span>
3601     [255   255   255   255   255   255   255   255   255   255   255   255   255   255   255   255
3602     255     0     0     0   255   255   255   255   255   255   255   255     0     0     0   255
3603     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3604     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3605     255     0   255   255    99   255   255    99   255   255    99   255    99   255     0   255
3606     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3607     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3608     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3609     255     0   255   255    99   255    99   255    99   255   255    99   255   255     0   255
3610     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3611     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3612     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3613     255     0   255    99   255    99   255    99   255   255    99   255    99   255     0   255
3614     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3615     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3616     255     0     0     0   255   255   255   255   255   255   255   255     0     0     0   255]/255;
3617 
3618 icons(idx).data(:,:,3) = <span class="keyword">...</span>
3619     [255   255   255   255   255   255   255   255   255   255   255   255   255   255   255   255
3620     255     0     0     0   255   255   255   255   255   255   255   255     0     0     0   255
3621     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3622     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3623     255     0   255   255    99   255   255    99   255   255    99   255    99   255     0   255
3624     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3625     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3626     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3627     255     0   255   255    99   255    99   255    99   255   255    99   255   255     0   255
3628     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3629     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3630     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3631     255     0   255    99   255    99   255    99   255   255    99   255    99   255     0   255
3632     255     0   255   255    99   255   255    99   255   255   255    99   255   255     0   255
3633     255     0   255   255   255   255   255   255   255   255   255   255   255   255     0   255
3634     255     0     0     0   255   255   255   255   255   255   255   255     0     0     0   255]/255;
3635 
3636 <span class="comment">% Export bathymetry dialog</span>
3637 idx = idx+1;
3638 icons(idx).data(:,:,1) = <span class="keyword">...</span>
3639     [226    226    226    226    226    226    226    197    220    226    226    226    226    226    226    226
3640     226    226    226    226    226    227    241    144    158    241    228    228    229    228    229    226
3641     226    243    243    243    237    237    246    164    119    242    232    225    226    218    243    206
3642     179    152    153    166    148    148    177    179    63    185    141    146    154    151    179    189
3643     167    4    134    175    151    164    161    198    122    255    212    233    215    199    140    185
3644     134    50    209    241    255    255    133    118    15    20    28    94    4    0    0    89
3645     136    0    0    0    0    0    0    0    0    0    0    0    0    21    56    140
3646     208    255    226    233    255    242    215    232    251    237    226    233    207    222    156    139
3647     172    159    152    153    166    145    178    147    169    164    161    163    154    153    128    135
3648     160    164    148    139    171    150    165    154    165    185    166    173    190    190    148    162
3649     214    233    211    203    217    212    217    238    202    236    213    222    230    224    184    184
3650     219    206    174    190    219    204    201    218    183    224    219    222    217    202    176    182
3651     210    182    183    214    225    220    203    229    175    217    220    220    222    212    184    185
3652     197    175    207    224    223    220    205    231    170    221    220    220    222    217    191    187
3653     186    193    223    224    220    201    203    228    171    224    218    220    222    215    190    187
3654     189    211    220    216    204    201    214    213    187    213    216    220    220    212    193    189
3655     ]/255;
3656 icons(idx).data(:,:,2) = <span class="keyword">...</span>
3657     [233    233    233    233    233    233    233    204    227    233    233    233    233    233    233    233
3658     233    233    233    233    233    234    247    152    167    247    235    234    235    234    236    233
3659     233    242    242    240    236    237    247    170    131    243    234    231    234    224    245    212
3660     208    193    199    209    196    196    211    197    100    211    194    196    200    199    202    196
3661     205    19    179    199    183    197    182    179    162    255    217    246    234    231    191    199
3662     167    47    229    240    255    252    139    154    87    86    99    139    79    46    23    121
3663     175    30    47    29    28    19    5    41    33    39    54    55    65    83    81    185
3664     236    255    249    253    255    251    240    255    235    255    247    252    233    245    204    190
3665     208    200    195    196    204    192    214    202    144    215    201    201    195    195    177    186
3666     200    201    189    183    206    192    204    210    111    231    209    214    222    223    199    209
3667     245    255    251    247    254    254    252    255    156    255    254    255    255    254    235    232
3668     249    244    227    237    247    244    242    255    132    239    254    250    247    244    228    231
3669     245    231    231    246    253    249    243    255    119    223    255    251    250    245    229    232
3670     239    227    244    251    251    248    244    255    110    217    255    250    251    246    233    233
3671     233    237    250    252    249    242    246    255    115    209    255    250    251    246    232    232
3672     234    245    249    247    242    242    246    231    154    192    246    249    249    245    234    233
3673     ]/255;
3674 icons(idx).data(:,:,3) = <span class="keyword">...</span>
3675     [233    233    233    233    233    233    233    204    227    233    233    233    233    233    233    233
3676     233    233    233    233    233    234    247    152    167    247    235    234    235    234    236    233
3677     233    242    242    240    236    237    247    170    131    243    234    231    234    224    245    212
3678     208    193    199    209    196    196    211    197    100    211    194    196    200    199    202    196
3679     205    19    179    199    183    197    182    179    162    255    217    246    234    231    191    199
3680     167    47    229    240    255    252    139    154    87    86    99    139    79    46    23    121
3681     175    30    47    29    28    19    5    41    33    39    54    55    65    83    81    185
3682     236    255    249    253    255    251    240    255    235    255    247    252    233    245    204    190
3683     208    200    195    196    204    192    214    202    144    215    201    201    195    195    177    186
3684     200    201    189    183    206    192    204    210    111    231    209    214    222    223    199    209
3685     245    255    251    247    254    254    252    255    156    255    254    255    255    254    235    232
3686     249    244    227    237    247    244    242    255    132    239    254    250    247    244    228    231
3687     245    231    231    246    253    249    243    255    119    223    255    251    250    245    229    232
3688     239    227    244    251    251    248    244    255    110    217    255    250    251    246    233    233
3689     233    237    250    252    249    242    246    255    115    209    255    250    251    246    232    232
3690     234    245    249    247    242    242    246    231    154    192    246    249    249    245    234    233
3691     ]/255;
3692 
3693 <span class="comment">% Export Figures Dialog</span>
3694 idx = idx + 1;
3695 icons(idx).data(:,:,1) = <span class="keyword">...</span>
3696     [NaN    NaN    10    23    23    23    23    23    23    23    21    3    NaN    NaN    NaN    NaN
3697     NaN    NaN    67    255    255    255    255    255    255    255    201    141    NaN    NaN    NaN    NaN
3698     NaN    NaN    43    255    241    240    241    246    252    255    186    220    151    NaN    NaN    NaN
3699     NaN    NaN    42    255    238    237    237    236    238    254    210    178    214    38    NaN    NaN
3700     NaN    NaN    43    255    241    241    241    241    240    244    252    255    255    79    NaN    NaN
3701     NaN    NaN    47    255    232    232    225    224    224    223    220    238    255    69    NaN    NaN
3702     NaN    NaN    55    233    114    225    230    223    221    221    215    237    255    67    NaN    NaN
3703     4    NaN    37    181    168    126    193    214    205    200    203    242    255    67    NaN    NaN
3704     41    164    134    153    144    139    131    209    238    223    242    240    255    67    NaN    NaN
3705     41    118    91    91    122    125    120    106    170    241    245    241    255    67    NaN    NaN
3706     41    113    91    89    97    108    99    89    117    205    190    230    255    67    NaN    NaN
3707     41    124    94    88    78    74    81    179    255    252    244    241    255    67    NaN    NaN
3708     13    34    76    187    88    92    222    255    255    250    250    250    255    73    NaN    NaN
3709     NaN    NaN    69    236    121    227    255    243    238    238    238    238    255    82    NaN    NaN
3710     NaN    NaN    NaN    0    0    0    0    0    0    0    0    0    0    0    NaN    NaN]/255;
3711 
3712 
3713 icons(idx).data(:,:,2) = <span class="keyword">...</span>
3714     [NaN    NaN    10    24    24    24    24    24    24    24    22    4    NaN    NaN    NaN    NaN
3715     NaN    NaN    69    255    255    255    255    255    255    255    204    144    NaN    NaN    NaN    NaN
3716     NaN    NaN    45    255    241    240    241    246    252    255    189    222    155    NaN    NaN    NaN
3717     NaN    NaN    43    255    238    237    237    236    238    254    210    179    215    39    NaN    NaN
3718     NaN    NaN    44    255    241    241    241    241    240    244    252    255    255    80    NaN    NaN
3719     NaN    NaN    49    255    231    230    225    224    224    223    220    238    255    70    NaN    NaN
3720     NaN    NaN    56    227    136    214    227    223    221    221    215    237    255    68    NaN    NaN
3721     4    NaN    19    157    243    154    181    210    204    200    203    242    255    67    NaN    NaN
3722     51    255    231    225    219    217    172    197    232    222    242    240    255    67    NaN    NaN
3723     52    227    184    183    195    201    204    172    169    239    245    241    255    67    NaN    NaN
3724     51    218    177    177    180    187    187    177    130    202    190    230    255    67    NaN    NaN
3725     51    237    195    183    172    170    152    175    255    251    244    241    255    67    NaN    NaN
3726     15    38    72    173    183    149    211    255    255    250    250    250    255    73    NaN    NaN
3727     NaN    NaN    65    226    174    214    252    242    238    238    238    238    255    84    NaN    NaN
3728     NaN    NaN    NaN    0    0    0    0    0    0    0    0    0    0    0    NaN    NaN]/255;
3729 
3730 
3731 icons(idx).data(:,:,3) = <span class="keyword">...</span>
3732     [NaN    NaN    9    23    23    23    23    23    23    23    21    3    NaN    NaN    NaN    NaN
3733     NaN    NaN    66    255    255    255    255    255    255    255    196    139    NaN    NaN    NaN    NaN
3734     NaN    NaN    42    255    239    238    238    244    252    255    186    216    148    NaN    NaN    NaN
3735     NaN    NaN    41    255    236    235    235    234    237    251    210    176    212    36    NaN    NaN
3736     NaN    NaN    42    255    239    239    239    239    238    241    252    255    255    78    NaN    NaN
3737     NaN    NaN    46    255    233    232    224    223    223    223    219    235    255    67    NaN    NaN
3738     NaN    NaN    53    240    101    232    230    221    219    218    213    235    255    65    NaN    NaN
3739     5    NaN    60    212    94    107    205    215    203    198    201    240    255    66    NaN    NaN
3740     34    56    40    80    70    62    94    222    241    221    240    238    255    66    NaN    NaN
3741     35    10    2    0    51    55    36    46    176    240    243    239    255    66    NaN    NaN
3742     35    11    9    7    16    34    12    6    110    204    188    228    255    66    NaN    NaN
3743     35    14    0    0    0    0    14    187    255    251    242    239    255    66    NaN    NaN
3744     12    37    84    206    0    41    234    255    255    248    248    248    255    72    NaN    NaN
3745     NaN    NaN    69    249    79    239    255    240    236    236    236    236    255    80    NaN    NaN
3746     NaN    NaN    NaN    0    0    0    0    0    0    0    0    0    0    0    NaN    NaN]/255;
3747 
3748 
3749 <span class="comment">% [EOF] getIcons</span>
3750 
3751 <a name="_sub100" href="#_subfunctions" class="code">function guiparams = createGUIparams</a>
3752 <span class="comment">% Creates the guiparams structure with specified defaults.</span>
3753 
3754 <span class="comment">% Organized by GUI panels</span>
3755 <span class="comment">%%%%%%%%%%%%%%%%%%%</span>
3756 <span class="comment">% SHIPTRACKS PLOT %</span>
3757 <span class="comment">%%%%%%%%%%%%%%%%%%%</span>
3758 guiparams.horizontal_grid_node_spacing       = 1.0;
3759 
3760 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%</span>
3761 <span class="comment">% CROSS SECTION PLOT %</span>
3762 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%</span>
3763 guiparams.contours                           = <span class="string">''</span>; <span class="comment">% Set below</span>
3764 guiparams.contour                            = <span class="string">''</span>; <span class="comment">% Set below</span>
3765 guiparams.idx_contour                        = 1;
3766 guiparams.vertical_exaggeration              = 10;
3767 guiparams.vector_scale_cross_section         = 0.2;
3768 guiparams.horizontal_vector_spacing          = 1;
3769 guiparams.vertical_vector_spacing            = 1;
3770 guiparams.horizontal_smoothing_window        = 1;
3771 guiparams.vertical_smoothing_window          = 1;
3772 guiparams.plot_secondary_flow_vectors        = true;
3773 guiparams.secondary_flows                    = <span class="string">''</span>; <span class="comment">% Set below</span>
3774 guiparams.secondary_flow_vector_variable     = <span class="string">''</span>; <span class="comment">% Set below</span>
3775 guiparams.idx_secondary_flow_vector_variable = 1;
3776 guiparams.include_vertical_velocity          = true;
3777 
3778 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
3779 <span class="comment">% PLAN VIEW PLOT %</span>
3780 <span class="comment">%%%%%%%%%%%%%%%%%%</span>
3781 guiparams.depth_range_min                    = 0;
3782 guiparams.depth_range_max                    = inf;
3783 guiparams.vector_scale_plan_view             = 1;
3784 guiparams.vector_spacing_plan_view           = 1;
3785 guiparams.smoothing_window_size              = 1;
3786 guiparams.map_depth_averaged_velocities      = true;
3787 guiparams.display_shoreline                  = false;
3788 guiparams.add_background                     = false;
3789 
3790 <span class="comment">%%%%%%%%%%%%%%%</span>
3791 <span class="comment">% DATA EXPORT %</span>
3792 <span class="comment">%%%%%%%%%%%%%%%</span>
3793 guiparams.beam_angle                         = 20.0;
3794 guiparams.magnetic_variation                 = 0.0;
3795 guiparams.wse                                = 0.0;
3796 guiparams.output_auxiliary_data              = false;
3797 
3798 <span class="comment">%%%%%%%%%%%%%%%%%%%%%</span>
3799 <span class="comment">% Contour variables %</span>
3800 <span class="comment">%%%%%%%%%%%%%%%%%%%%%</span>
3801 idx = 1;
3802 guiparams.contours(idx).string   = <span class="string">'Streamwise Velocity (u)'</span>;
3803 guiparams.contours(idx).variable = <span class="string">'streamwise'</span>;
3804 idx = idx + 1;
3805 guiparams.contours(idx).string   = <span class="string">'Transverse Velocity (v)'</span>;
3806 guiparams.contours(idx).variable = <span class="string">'transverse'</span>;
3807 idx = idx + 1;
3808 guiparams.contours(idx).string   = <span class="string">'Vertical Velocity (w)'</span>;
3809 guiparams.contours(idx).variable = <span class="string">'vertical'</span>;
3810 idx = idx + 1;
3811 guiparams.contours(idx).string   = <span class="string">'Velocity Magnitude'</span>;
3812 guiparams.contours(idx).variable = <span class="string">'mag'</span>;
3813 idx = idx + 1;
3814 guiparams.contours(idx).string   = <span class="string">'Primary Velocity (zsd)'</span>;
3815 guiparams.contours(idx).variable = <span class="string">'primary_zsd'</span>;
3816 idx = idx + 1;
3817 guiparams.contours(idx).string   = <span class="string">'Secondary Velocity (zsd)'</span>;
3818 guiparams.contours(idx).variable = <span class="string">'secondary_zsd'</span>;
3819 idx = idx + 1;
3820 guiparams.contours(idx).string   = <span class="string">'Primary Velocity (Roz)'</span>;
3821 guiparams.contours(idx).variable = <span class="string">'primary_roz'</span>;
3822 idx = idx + 1;
3823 guiparams.contours(idx).string   = <span class="string">'Secondary Velocity (Roz)'</span>;
3824 guiparams.contours(idx).variable = <span class="string">'secondary_roz'</span>;
3825 idx = idx + 1;
3826 guiparams.contours(idx).string   = <span class="string">'Prim. Vel. (Roz, Downstream Comp.)'</span>;
3827 guiparams.contours(idx).variable = <span class="string">'primary_roz_x'</span>;
3828 idx = idx + 1;
3829 guiparams.contours(idx).string   = <span class="string">'Prim. Vel. (Roz, Cross-Stream Comp.)'</span>;
3830 guiparams.contours(idx).variable = <span class="string">'primary_roz_y'</span>;
3831 idx = idx + 1;
3832 guiparams.contours(idx).string   = <span class="string">'Sec. Vel. (Roz, Downstream Comp.)'</span>;
3833 guiparams.contours(idx).variable = <span class="string">'secondary_roz_x'</span>;
3834 idx = idx + 1;
3835 guiparams.contours(idx).string   = <span class="string">'Sec. Vel. (Roz, Cross-Stream Comp.)'</span>;
3836 guiparams.contours(idx).variable = <span class="string">'secondary_roz_y'</span>;
3837 idx = idx + 1;
3838 guiparams.contours(idx).string   = <span class="string">'Backscatter'</span>;
3839 guiparams.contours(idx).variable = <span class="string">'backscatter'</span>;
3840 idx = idx + 1;
3841 guiparams.contours(idx).string   = <span class="string">'Flow Direction (deg.)'</span>;
3842 guiparams.contours(idx).variable = <span class="string">'flowangle'</span>;
3843 
3844 guiparams.contour = guiparams.contours(guiparams.idx_contour).variable;
3845 
3846 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
3847 <span class="comment">% Secondary Flow Vector Variables %</span>
3848 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
3849 idx = 1;
3850 guiparams.secondary_flows(idx).string   = <span class="string">'Transverse'</span>;
3851 guiparams.secondary_flows(idx).variable = <span class="string">'transverse'</span>;
3852 idx = idx + 1;
3853 guiparams.secondary_flows(idx).string   = <span class="string">'Secondary (zsd)'</span>;
3854 guiparams.secondary_flows(idx).variable = <span class="string">'secondary_zsd'</span>;
3855 idx = idx + 1;
3856 guiparams.secondary_flows(idx).string   = <span class="string">'Secondary (Roz)'</span>;
3857 guiparams.secondary_flows(idx).variable = <span class="string">'secondary_roz'</span>;
3858 idx = idx + 1;
3859 guiparams.secondary_flows(idx).string   = <span class="string">'Secondary (Roz, Cross-Stream Comp)'</span>;
3860 guiparams.secondary_flows(idx).variable = <span class="string">'secondary_roz_y'</span>;
3861 idx = idx + 1;
3862 guiparams.secondary_flows(idx).string   = <span class="string">'Primary (Roz, Cross-Stream Comp)'</span>;
3863 guiparams.secondary_flows(idx).variable  = <span class="string">'primary_roz_y'</span>;
3864 
3865 guiparams.secondary_flow_vector_variable = <span class="keyword">...</span>
3866     guiparams.secondary_flows(guiparams.idx_secondary_flow_vector_variable).variable;
3867 
3868 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
3869 <span class="comment">% INTERNAL SETTINGS &amp; DEFAULTS %</span>
3870 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
3871 <span class="comment">% Menu bar options</span>
3872 guiparams.presentation                       = true;
3873 guiparams.print                              = false;
3874 guiparams.set_cross_section_endpoints        = false;
3875 guiparams.unit_discharge_correction          = false;
3876 guiparams.english_units                      = false;
3877 guiparams.vertical_offset                    = 0;
3878 <span class="comment">% guiparams.plot_ship_tracks                   = false;</span>
3879 <span class="comment">% guiparams.plot_planview                      = false;</span>
3880 <span class="comment">% guiparams.plot_cross_section                 = false;</span>
3881 
3882 <span class="comment">% File location defaults</span>
3883 guiparams.ascii_path                        = pwd;
3884 guiparams.ascii_file                        = <span class="string">''</span>;
3885 guiparams.mat_path                          = pwd;
3886 guiparams.mat_file                          = <span class="string">''</span>;
3887 guiparams.tecplot_path                      = pwd;
3888 guiparams.tecplot_file                      = <span class="string">''</span>;
3889 guiparams.kmz_path                          = pwd;
3890 guiparams.kmz_file                          = <span class="string">''</span>;
3891 guiparams.multibeambathymetry_path          = pwd;
3892 guiparams.multibeambathymetry_file          = <span class="string">''</span>;
3893 guiparams.log_path                          = pwd;
3894 guiparams.log_file                          = <span class="string">''</span>;
3895 guiparams.has_mapping_toolbox               = <span class="keyword">...</span>
3896     ~isempty(dir(fullfile(matlabroot,<span class="string">'toolbox'</span>,<span class="string">'map'</span>)));
3897 
3898 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
3899 <span class="comment">% IN MEMORY DATA STORAGE %</span>
3900 <span class="comment">%%%%%%%%%%%%%%%%%%%%%%%%%%</span>
3901 guiparams.z                    = [];
3902 guiparams.A                    = [];
3903 guiparams.V                    = [];
3904 guiparams.Map                  = [];
3905 guiparams.savefile             = [];
3906 guiparams.planview_output_data = [];
3907 <span class="comment">% guiparams.zmin = []; % Don't need to store these?</span>
3908 <span class="comment">% guiparams.zmax = [];</span>
3909 <span class="comment">% guiprefs = getappdata(handles.figure1,'guiprefs');</span>
3910 guiparams.data_folder = <span class="string">''</span>;
3911 guiparams.data_files  = {<span class="string">''</span>};
3912 
3913 <span class="comment">% [EOF] createGUIparams</span>
3914 
3915 <span class="comment">% [EOF] VMT</span>
3916 
3917</pre></div>
<hr><address>Generated on Thu 21-Mar-2013 09:32:01 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2005</address>
</body>
</html>